Remove redundant array access in Checkpoints (#5169)

Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Hadrien Croubois
2024-08-29 22:38:31 +02:00
parent 4f0644c7e8
commit 40dd647022
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}));
}