MCPcopy Create free account
hub / github.com/freecodexyz/free-code / difference

Function difference

src/utils/set.ts:4–12  ·  view source on GitHub ↗
(a: Set<A>, b: Set<A>)

Source from the content-addressed store, hash-verified

2 * Note: this code is hot, so is optimized for speed.
3 */
4export function difference<A>(a: Set<A>, b: Set<A>): Set<A> {
5 const result = new Set<A>()
6 for (const item of a) {
7 if (!b.has(item)) {
8 result.add(item)
9 }
10 }
11 return result
12}
13
14/**
15 * Note: this code is hot, so is optimized for speed.

Callers

nothing calls this directly

Calls 2

hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected