Skip to content

Commit

Permalink
Updated snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
jchook committed Jun 10, 2020
1 parent 7ea7f60 commit 4e98a5a
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions jest/__snapshots__/bundles-snapshot.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,7 @@ exports[`Dist bundle is unchanged 1`] = `
cacheSize = _ref.cacheSize;
validateCacheSize(cacheSize);
this._cache = {};
this._cacheKeys = [];
this._cacheLength = 0;
this.clear();
this._cacheSize = cacheSize;
}
Expand All @@ -404,10 +402,8 @@ exports[`Dist bundle is unchanged 1`] = `
if (index > -1) {
delete this._cache[key];
var lastIndex = this._cacheLength - 1;
var lastKey = this._cacheKeys[lastIndex];
this._cacheKeys[index] = lastKey;
this._cacheLength--;
this._cacheKeys[index] = this._cacheKeys[this._cacheLength];
}
};
Expand All @@ -419,8 +415,7 @@ exports[`Dist bundle is unchanged 1`] = `
_proto._randomReplace = function _randomReplace(newKey, newValue) {
var index = Math.floor(Math.random() * this._cacheLength);
var key = this._cacheKeys[index];
delete this._cache[key];
delete this._cache[this._cacheKeys[index]];
this._cacheKeys[index] = newKey;
this._cache[newKey] = newValue;
};
Expand Down Expand Up @@ -460,14 +455,13 @@ exports[`Dist bundle is unchanged 1`] = `
};
_proto.remove = function remove(key) {
var index = this._cacheKeys.indexOf(key);
var index = this._cacheKeys.indexOf(key); // O(1)
if (index > -1) {
delete this._cache[\\"delete\\"](key);
var lastIndex = this._cacheLength - 1;
var lastKey = this._cacheKeys[lastIndex];
this._cacheKeys[index] = lastKey;
this._cacheLength--;
this._cacheKeys[index] = this._cacheKeys[this._cacheLength];
}
};
Expand All @@ -479,9 +473,8 @@ exports[`Dist bundle is unchanged 1`] = `
_proto._randomReplace = function _randomReplace(newKey, newValue) {
var index = Math.floor(Math.random() * this._cacheLength);
var key = this._cacheKeys[index];
this._cache[\\"delete\\"](key);
this._cache[\\"delete\\"](this._cacheKeys[index]);
this._cacheKeys[index] = newKey;
Expand Down

0 comments on commit 4e98a5a

Please sign in to comment.