diff --git a/src/utils/entityIdMapper.ts b/src/utils/entityIdMapper.ts index e89dab70..6506e092 100644 --- a/src/utils/entityIdMapper.ts +++ b/src/utils/entityIdMapper.ts @@ -13,10 +13,10 @@ * @module utils/entityIdMapper */ -import type { BaseStorage } from '../storage/baseStorage.js' +import type { StorageAdapter } from '../coreTypes.js' export interface EntityIdMapperOptions { - storage: BaseStorage + storage: StorageAdapter storageKey?: string } @@ -30,7 +30,7 @@ export interface EntityIdMapperData { * Maps entity UUIDs to integer IDs for use with Roaring Bitmaps */ export class EntityIdMapper { - private storage: BaseStorage + private storage: StorageAdapter private storageKey: string // Bidirectional maps diff --git a/src/utils/metadataIndex.ts b/src/utils/metadataIndex.ts index b86a2e32..63f7f9e5 100644 --- a/src/utils/metadataIndex.ts +++ b/src/utils/metadataIndex.ts @@ -580,7 +580,7 @@ export class MetadataIndexManager { } // Combine multiple bitmaps with OR operation - return RoaringBitmap32.or(...bitmaps) + return RoaringBitmap32.orMany(bitmaps) } /** @@ -623,7 +623,11 @@ export class MetadataIndexManager { // Hardware-accelerated intersection using SIMD instructions (AVX2/SSE4.2) // This is 500-900x faster than JavaScript array filtering - const intersectionBitmap = RoaringBitmap32.and(...bitmaps) + // Note: RoaringBitmap32.and() only takes 2 params, so we reduce manually + let intersectionBitmap = bitmaps[0] + for (let i = 1; i < bitmaps.length; i++) { + intersectionBitmap = RoaringBitmap32.and(intersectionBitmap, bitmaps[i]) + } // Check if empty before converting if (intersectionBitmap.size === 0) {