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

Function intersects

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

Source from the content-addressed store, hash-verified

15 * Note: this code is hot, so is optimized for speed.
16 */
17export function intersects<A>(a: Set<A>, b: Set<A>): boolean {
18 if (a.size === 0 || b.size === 0) {
19 return false
20 }
21 for (const item of a) {
22 if (b.has(item)) {
23 return true
24 }
25 }
26 return false
27}
28
29/**
30 * Note: this code is hot, so is optimized for speed.

Callers

nothing calls this directly

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected