From 01ffa070eedeb17e6de4c14f96be32c9323dbe30 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 1 Dec 2021 17:05:23 -0500 Subject: [PATCH] Pad: Only check `getKeyRevisionNumber()` at key revisions Checking every revision is more of a unit test than a consistency check, and limiting checks to key revisions should improve performance considerably. --- src/node/db/Pad.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index 34da29892..2c788950e 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -678,7 +678,9 @@ class Pad { assert.equal(op.attribs, AttributeMap.fromString(op.attribs, pool).toString()); } atext = Changeset.applyToAText(changeset, atext, pool); - assert.deepEqual(await this.getInternalRevisionAText(r), atext); + if (r === this.getKeyRevisionNumber(r)) { + assert.deepEqual(await this._getKeyRevisionAText(r), atext); + } } } catch (err) { const pfx = `(pad ${this.id} revision ${r}) `;