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.
This commit is contained in:
Richard Hansen 2021-12-01 17:05:23 -05:00
parent fa0d77c11d
commit 01ffa070ee
1 changed files with 3 additions and 1 deletions

View File

@ -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}) `;