Remove redundant array access in Checkpoints (#5169)

This commit is contained in:
Hadrien Croubois
2024-08-29 22:38:31 +02:00
committed by GitHub
parent 37619479cd
commit 1e7ca3eea6
2 changed files with 4 additions and 4 deletions

View File

@ -147,7 +147,7 @@ function _insert(${opts.checkpointTypeName}[] storage self, ${opts.keyTypeName}
// Update or push new checkpoint
if (lastKey == key) {
_unsafeAccess(self, pos - 1).${opts.valueFieldName} = value;
last.${opts.valueFieldName} = value;
} else {
self.push(${opts.checkpointTypeName}({${opts.keyFieldName}: key, ${opts.valueFieldName}: value}));
}