I think this will only work if the components are sorted. If the array with components is not sorted by ID it'll give incorrect results.
One way to fix this, is to keep using your hash-map as usual, but generate the above keys array on each update - i.e. extract the map's keys and sort them by it's values before running the update loop.
This is the main idea of having the extra indirection there
N.B. sorting your entire systems can be handy too sometimes. e.g. if Render held [A,B,C,D], but Location held [D,A,C,B], then your update function is going to be iterating forward through the render array, but randomly through the location array. If you first sort them both by their entity IDs, then your update function will be faster due to better cache patterns.
I didn't think of eliminating the values array like that, it's definately a good point. It makes it a bit easier to think about that way, since I then only need to reconcile the two arrays:
array from LocationSystem: [0, 1, 2]; array from RenderSystem: [0, 2];I think I can safely set the extra limitation that those indexes will be sorted, although that does mean I'll need to move a lot of components if I erase an item in the middle.