npm / node-semver

The semver parser for node (the one npm uses)
ISC License
5.09k stars 492 forks source link

fix(lru): use map.delete() directly #713

Closed negezor closed 5 months ago

negezor commented 5 months ago

The default implementation already returns boolean if the value has been deleted.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete#return_value

It's also faster since we don't double check the hashmap for a value.

mbtools commented 5 months ago

Thanks for the optimization 😊