example neaten

This commit is contained in:
John Kerl 2017-02-20 22:10:31 -05:00
parent 81f6bd4910
commit 2f65f03f44
2 changed files with 10 additions and 12 deletions

View file

@ -817,13 +817,12 @@ $ cat data/maxrows.mlr
@maxn = max(@maxn, $n);
# After all records have been read, loop through retained records
# and print those with the max n value
# and print those with the max n value.
end {
for ((nr,k),v in @records) {
if (k == "n") {
if (@records[nr]["n"] == @maxn) {
emit @records[nr]
}
for (int nr in @records) {
map record = @records[nr];
if (record["n"] == @maxn) {
emit record;
}
}
}

View file

@ -4,13 +4,12 @@
@maxn = max(@maxn, $n);
# After all records have been read, loop through retained records
# and print those with the max n value
# and print those with the max n value.
end {
for ((nr,k),v in @records) {
if (k == "n") {
if (@records[nr]["n"] == @maxn) {
emit @records[nr]
}
for (int nr in @records) {
map record = @records[nr];
if (record["n"] == @maxn) {
emit record;
}
}
}