Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Obj {
- Type data
- int index;
- }
- array:Array<Obj> = [....];
- function remove(obj:Obj, array:Array<Obj>) {
- var swp = array[array.length-1];
- swp.index = obj.index;
- array[obj.index] = swp;
- array.pop();
- }
Add Comment
Please, Sign In to add comment