final collection:ArrayHierarchicalCollection<Int>
= new ArrayHierarchicalCollection<Int>([3, 2, 1]);
trace(collection.get([0]) + " == " + 3);
trace(collection.get([1]) + " == " + 2);
collection.sortCompareFunction = Reflect.compare; //Ascending order
trace(collection.get([0]) + " == " + 1);
trace(collection.get([1]) + " == " + 2);
collection.filterFunction = (value:Int) -> value != 2;
trace(collection.get([0]) + " == " + 1);
trace(collection.get([1]) + " == " + 3);
//Replace 1 with 5 so the source array is [3, 2, 5].
//With 2 filtered out, it should show up as [3, 5].
collection.set([0], 5);
trace(collection.get([0]) + " == " + 3); //5 == 3
trace(collection.get([1]) + " == " + 5); //3 == 5
@:privateAccess collection.refreshFilterAndSort();
trace(collection.get([0]) + " == " + 3);
trace(collection.get([1]) + " == " + 5);
There aren't enough branches to handle this case! But really, there are too many branches, that's the only reason this got missed.
There aren't enough branches to handle this case! But really, there are too many branches, that's the only reason this got missed.