As discussed on Discord, returning a List from QueryableOrderedSet.query() leads to bugs. The developer assumes they own the returned list, then modify it in place (with removeWhere(), for example) to avoid creating yet another iterable. Unbeknownst to the, they're modifying the internal cache of the QueryableOrderedSet.
We agreed to make the breaking change of returning Iterable<C> on this line. Nothing other than that function needs to change, as List is already an Iterable, so we're only exposing the same data structure as a different static type.
This is breaking because people can have the results of query() assigned to typed variables, such as List<Entity> blah = world.query<Entity>();. But that's easy to fix.
If anyone is actually using the return of query() as a modifiable List (as in, they modify it), then that's likely a bug. The change will uncover the bug, so all's good.
The only other valid thing that this could change is code such as var something = blah[index], or for (int i = 0; i < blah.length; i++) doThing(blah[i]);. These are probably rare but valid.
As discussed on Discord, returning a
List
fromQueryableOrderedSet.query()
leads to bugs. The developer assumes they own the returned list, then modify it in place (withremoveWhere()
, for example) to avoid creating yet another iterable. Unbeknownst to the, they're modifying the internal cache of theQueryableOrderedSet
.We agreed to make the breaking change of returning
Iterable<C>
on this line. Nothing other than that function needs to change, asList
is already anIterable
, so we're only exposing the same data structure as a different static type.This is breaking because people can have the results of
query()
assigned to typed variables, such asList<Entity> blah = world.query<Entity>();
. But that's easy to fix.If anyone is actually using the return of
query()
as a modifiableList
(as in, they modify it), then that's likely a bug. The change will uncover the bug, so all's good.The only other valid thing that this could change is code such as
var something = blah[index]
, orfor (int i = 0; i < blah.length; i++) doThing(blah[i]);
. These are probably rare but valid.cc @spydon