MCPcopy Index your code
hub / github.com/Effect-TS/effect / removeFromBucket

Function removeFromBucket

packages/effect/src/MutableHashMap.ts:251–263  ·  view source on GitHub ↗
(
  self: MutableHashMap<K, V>,
  bucket: NonEmptyArray<readonly [K & Equal.Equal, V]>,
  key: K & Equal.Equal
)

Source from the content-addressed store, hash-verified

249})
250
251const removeFromBucket = <K, V>(
252 self: MutableHashMap<K, V>,
253 bucket: NonEmptyArray<readonly [K & Equal.Equal, V]>,
254 key: K & Equal.Equal
255) => {
256 for (let i = 0, len = bucket.length; i < len; i++) {
257 if (key[Equal.symbol](bucket[i][0])) {
258 bucket.splice(i, 1)
259 self.bucketsSize--
260 return
261 }
262 }
263}
264
265/**
266 * Updates the value of the specified key within the `MutableHashMap` if it exists.

Callers 1

MutableHashMap.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected