diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2023-03-27 07:29:30 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2023-03-27 07:29:30 -0700 |
commit | e4159856ad6406d5df4077cb0a41263b7e54b5bb (patch) | |
tree | 1226c2a7c21f4db73d2568236875076fa2a310d2 /backomp | |
parent | 406170b92dd9379a9f4791c3c285855b36f2af84 (diff) | |
download | backomp-e4159856ad6406d5df4077cb0a41263b7e54b5bb.tar.gz backomp-e4159856ad6406d5df4077cb0a41263b7e54b5bb.tar.xz |
simplify skip logic
Diffstat (limited to 'backomp')
-rwxr-xr-x | backomp | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -3,7 +3,9 @@ set -e ! read -rd '' FILTER_AWK <<'EOF' -function flr(n, s) { return int(n / s) * s } +function flr(n, s) { + return int(n / s) * s +} BEGIN { len = split("h d w m", arr) @@ -31,12 +33,13 @@ BEGIN { for (i = 1; i <= n_buckets; ++i) { b = buckets[i] - if (skip = (repl[b] && bt[b] == last[b, b])) { + if (repl[b] && bt[b] == last[b, b]) { for (j = 1; j < i; ++j) { - skip = (bt[buckets[j]] != last[b, buckets[j]]) - if (!skip) break + if (bt[buckets[j]] == last[b, buckets[j]]) + break } - if (skip) next + if (j == i) + next } if ((b, bt[b]) in bkeep || ret[b] == "*" || bc[b]++ < ret[b]) @@ -52,7 +55,8 @@ END { ++keep[bkeep[i]] asorti(keep) - for (i in keep) print keep[i] + for (i in keep) + print keep[i] } EOF |