Blitzmax WAS a good idea

Miscellaneous Forums/General Discussion/Blitzmax WAS a good idea

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

But in a situation were you are going to be doing it every loop (And you have chosen to use arrays rather than lists), you wouldnt bother resizing, you would just NULL that entry.

Exactly, but....

iterating through an array with a load of nulls in it is wasteful of memory and time.

Also correct. So the solution is simple.

1. You have an array and entry 23 dies.
2. Swap the last item with that item
3. Slice down by 1 entry.
4. tada! You've deleted an entry without iterating through the whole thing.