MCPcopy Index your code
hub / github.com/angular/angular / bloomHasToken

Function bloomHasToken

packages/core/src/render3/di.ts:849–867  ·  view source on GitHub ↗
(
  bloomHash: number,
  injectorIndex: number,
  injectorView: LView | TData,
)

Source from the content-addressed store, hash-verified

847}
848
849export function bloomHasToken(
850 bloomHash: number,
851 injectorIndex: number,
852 injectorView: LView | TData,
853) {
854 // Create a mask that targets the specific bit associated with the directive we're looking for.
855 // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
856 // to bit positions 0 - 31 in a 32 bit integer.
857 const mask = 1 << bloomHash;
858
859 // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of
860 // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset
861 // that should be used.
862 const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
863
864 // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,
865 // this injector is a potential match.
866 return !!(value & mask);
867}
868
869/** Returns true if flags prevent parent injector from being searched for tokens */
870function shouldSearchParent(

Callers 2

di_spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…