Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
cosmonaut | 1dfa6ba4ef |
|
@ -60,12 +60,25 @@ namespace MoonTools.ECS.Collections
|
|||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
var lastElement = array[Count - 1];
|
||||
var index = indices[element];
|
||||
array[index] = lastElement;
|
||||
indices[lastElement] = index;
|
||||
count -= 1;
|
||||
indices.Remove(element);
|
||||
*/
|
||||
|
||||
var index = indices[element];
|
||||
|
||||
for (var i = index; i < Count - 1; i += 1)
|
||||
{
|
||||
array[i] = array[i + 1];
|
||||
indices[array[i]] = i;
|
||||
}
|
||||
|
||||
indices.Remove(element);
|
||||
count -= 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue