summaryrefslogtreecommitdiff
path: root/backomp
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2023-03-27 07:29:30 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2023-03-27 07:29:30 -0700
commite4159856ad6406d5df4077cb0a41263b7e54b5bb (patch)
tree1226c2a7c21f4db73d2568236875076fa2a310d2 /backomp
parent406170b92dd9379a9f4791c3c285855b36f2af84 (diff)
downloadbackomp-e4159856ad6406d5df4077cb0a41263b7e54b5bb.tar.gz
backomp-e4159856ad6406d5df4077cb0a41263b7e54b5bb.tar.xz
simplify skip logic
Diffstat (limited to 'backomp')
-rwxr-xr-xbackomp16
1 files changed, 10 insertions, 6 deletions
diff --git a/backomp b/backomp
index ae9bbce..13a4b3c 100755
--- a/backomp
+++ b/backomp
@@ -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