Commits

Tony Parker committed f9c1dd4386e
Adopt the new indexing model for better perf in IndexSet Concurrently with the development of struct IndexSet, the stdlib team was busy reworking the way that all indexes in collections worked (https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md). Both efforts landed at basically the same time. We did the minimum possible to adopt the new indexing model when IndexSet landed. This change more correctly adopts the new model. In summary, the new model has the Collection change the value of the Index, instead of the Index changing the value on its own. Previously, the Index had methods like successor(), but now the Collection has methods like index(after:). This means that the index no longer has to store a reference to the collection in many cases, which means that CoW semantics can kick in far more often as the index is a dead simple model object that just stores a bunch of integers. So basically, this change moves all the logic for moving indexes from Index into IndexSet. <rdar://problem/26269319> More fully adopt new indexing model for better performance in IndexSet