+# Optimized `GroupedArray` to use `Sprite::context_index` and avoid using `index_of`
+private class GroupedSprites
+ super GroupedArray[Sprite]
+
+ redef fun add(item)
+ do
+ var index = super
+ item.context_index = index
+ return index
+ end
+
+ redef fun remove(item) do remove_at(item, item.context_index)
+end
+