Skip to content

Commit

Permalink
slice → splice while moving entry to the top (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
heydiplo authored and erikras committed Feb 12, 2019
1 parent 8ef91af commit bb42316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lruCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function lruCache(limit, equals) {

// Cached entry not at top of cache, move it to the top
if (cacheIndex > 0) {
entries.slice(cacheIndex, 1)
entries.splice(cacheIndex, 1)
entries.unshift(entry)
}

Expand Down

0 comments on commit bb42316

Please sign in to comment.