From 0e424fa8c3ff517e6c9061c5e573c2142fc0b8e9 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 11 Apr 2021 23:35:00 -0400 Subject: [PATCH] skiplist: Remove unnecessary `newKey` arg from `_insertKeyAtPoint()` --- src/static/js/skiplist.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/static/js/skiplist.js b/src/static/js/skiplist.js index fb97bee41..c32e7cce3 100644 --- a/src/static/js/skiplist.js +++ b/src/static/js/skiplist.js @@ -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; }