public void Iterate_Over_KeysWithRefs() { var count = 10; var dictionary = GetDictionary(); var sw = Stopwatch.StartNew(); for (var i = 0; i < count; i++) { foreach (var key in dictionary.Keys) { var position = VoxelUtility.GetPositionByHash(key); var index = VoxelUtility.GetVoxelIndex(position, _voxelsSize); ref var voxel = ref _voxels[index]; var color = voxel.colorIndex; voxel.data = 0; voxel.colorIndex = 0; } }