From d5bdd1fdd6229353c06606fc83c27196d5c0f42a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 22 Sep 2022 15:29:25 +0200 Subject: Simplify checkpointing logic. --- rules.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 2f1d249..ec19468 100644 --- a/rules.js +++ b/rules.js @@ -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) { -- cgit v1.2.3