internal static NativeArray <ComponentType> GetNonzeroComponentTypes(this ArchetypeChunk self, Allocator allocator)
        {
            var nonZeroTypeCount = self.GetNonZeroSizedTypeCount();
            var result           = new NativeArray <ComponentType>(nonZeroTypeCount, allocator);

            for (int i = 0; i < nonZeroTypeCount; i++)
            {
                // nonzero types are stored at the beginning followed by all zero-sized types
                result[i] = self.GetComponentTypeAtIndex(i);
            }

            return(result);
        }