Skip to content

Commit

Permalink
remove redundancy in cache-map (#485)
Browse files Browse the repository at this point in the history
* remove redundancy

* fix lint
  • Loading branch information
Casheeew authored Dec 29, 2023
1 parent 0886252 commit 59961b6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion ext/js/general/cache-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class CacheMap {
*/
constructor(maxSize) {
if (!(
typeof maxSize === 'number' &&
Number.isFinite(maxSize) &&
maxSize >= 0 &&
Math.floor(maxSize) === maxSize
Expand Down
4 changes: 1 addition & 3 deletions test/cache-map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ function testConstructor() {
[true, () => new CacheMap(-1)],
[true, () => new CacheMap(1.5)],
[true, () => new CacheMap(Number.NaN)],
[true, () => new CacheMap(Number.POSITIVE_INFINITY)],
// @ts-expect-error - Ignore because it should throw an error
[true, () => new CacheMap('a')]
[true, () => new CacheMap(Number.POSITIVE_INFINITY)]
];

for (const [throws, create] of data) {
Expand Down

0 comments on commit 59961b6

Please sign in to comment.