diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-09-22 15:29:25 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 13:11:27 +0100 |
commit | d5bdd1fdd6229353c06606fc83c27196d5c0f42a (patch) | |
tree | 572a271f1455c0109808c944cd894749a61c3f82 /rules.js | |
parent | f8c759a3d71576463c3a9fa71a1e60d621a977ce (diff) | |
download | rommel-in-the-desert-d5bdd1fdd6229353c06606fc83c27196d5c0f42a.tar.gz |
Simplify checkpointing logic.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -7049,10 +7049,10 @@ exports.setup = function (seed, scenario, options) { } exports.is_checkpoint = function (a, b) { - if (!a.log) return true - let ax = a.log[a.log.length-2].startsWith(".h2") - let bx = b.log[b.log.length-2].startsWith(".h2") - return bx && (!ax || a.log.length !== b.log.length) + let an = 0, bn = 0 + for (let line of a.log) if (line.startsWith(".h2")) ++an + for (let line of b.log) if (line.startsWith(".h2")) ++bn + return an !== bn } exports.view = function(state, current) { |