You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Splice is mutative and as used would result in the item being removed at the given index. Slice is non-mutative and as used does nothing (aside from wasting cycles to create a copy of the array starting at index 1), therefore the cache entry will exist twice in the entries set (since it is not removed, then later prepended to the set).
The text was updated successfully, but these errors were encountered:
At this line, I expect you are intending to use
Array#splice
, notArray#slice
:lru-memoize/src/lruCache.js
Line 13 in 86f655e
Splice is mutative and as used would result in the item being removed at the given index. Slice is non-mutative and as used does nothing (aside from wasting cycles to create a copy of the array starting at index 1), therefore the cache entry will exist twice in the entries set (since it is not removed, then later prepended to the set).
The text was updated successfully, but these errors were encountered: