Ejemplo n.º 1
0
        public T[] Execute()
        {
            var bitsCount = 0;

            for (var i = 0; i < _queryResultBitMap.GetArray.Length; i++)
            {
                bitsCount += MathHelper.BitsCount((ulong)_queryResultBitMap.GetArray[i]);
            }

            if (bitsCount <= 0)
            {
                return(Array.Empty <T>());
            }

            var result      = new T[bitsCount];
            var resultIndex = 0;

            for (var i = 0; i < _bitMapIndex.Count; i++)
            {
                if (_queryResultBitMap.Get(i))
                {
                    result[resultIndex] = _bitMapIndex[i];
                    resultIndex++;
                }
            }

            return(result);
        }