skiplist: Remove unnecessary `newKey` arg from `_insertKeyAtPoint()`
parent
ab8c354f18
commit
0e424fa8c3
|
@ -113,9 +113,9 @@ class SkipList {
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
_insertKeyAtPoint(point, newKey, entry) {
|
_insertKeyAtPoint(point, entry) {
|
||||||
const newNode = {
|
const newNode = {
|
||||||
key: newKey,
|
key: entry.key,
|
||||||
levels: 0,
|
levels: 0,
|
||||||
upPtrs: [],
|
upPtrs: [],
|
||||||
downPtrs: [],
|
downPtrs: [],
|
||||||
|
@ -167,7 +167,7 @@ class SkipList {
|
||||||
up.downSkips[lvl]++;
|
up.downSkips[lvl]++;
|
||||||
up.downSkipWidths[lvl] += newWidth;
|
up.downSkipWidths[lvl] += newWidth;
|
||||||
}
|
}
|
||||||
this._keyToNodeMap[`$KEY$${newKey}`] = newNode;
|
this._keyToNodeMap[`$KEY$${newNode.key}`] = newNode;
|
||||||
this._numNodes++;
|
this._numNodes++;
|
||||||
this._totalWidth += newWidth;
|
this._totalWidth += newWidth;
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ class SkipList {
|
||||||
}
|
}
|
||||||
for (let i = (newEntryArray.length - 1); i >= 0; i--) {
|
for (let i = (newEntryArray.length - 1); i >= 0; i--) {
|
||||||
const entry = newEntryArray[i];
|
const entry = newEntryArray[i];
|
||||||
this._insertKeyAtPoint(pt, entry.key, entry);
|
this._insertKeyAtPoint(pt, entry);
|
||||||
const node = this._getNodeByKey(entry.key);
|
const node = this._getNodeByKey(entry.key);
|
||||||
node.entry = entry;
|
node.entry = entry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue