skiplist: Remove unnecessary `newKey` arg from `_insertKeyAtPoint()`

pull/5003/head
Richard Hansen 2021-04-11 23:35:00 -04:00
parent ab8c354f18
commit 0e424fa8c3
1 changed files with 4 additions and 4 deletions

View File

@ -113,9 +113,9 @@ class SkipList {
return n;
}
_insertKeyAtPoint(point, newKey, entry) {
_insertKeyAtPoint(point, entry) {
const newNode = {
key: newKey,
key: entry.key,
levels: 0,
upPtrs: [],
downPtrs: [],
@ -167,7 +167,7 @@ class SkipList {
up.downSkips[lvl]++;
up.downSkipWidths[lvl] += newWidth;
}
this._keyToNodeMap[`$KEY$${newKey}`] = newNode;
this._keyToNodeMap[`$KEY$${newNode.key}`] = newNode;
this._numNodes++;
this._totalWidth += newWidth;
}
@ -276,7 +276,7 @@ class SkipList {
}
for (let i = (newEntryArray.length - 1); i >= 0; i--) {
const entry = newEntryArray[i];
this._insertKeyAtPoint(pt, entry.key, entry);
this._insertKeyAtPoint(pt, entry);
const node = this._getNodeByKey(entry.key);
node.entry = entry;
}