D-Programming-Language/phobos — pull request #804 by monarchdodra (2012-09-18 16:40:09+00:00)
Title: container.Array consolidation

This two minor re-implementation changes to Array and Array.Range.

1.
Both are given "_get" which ALWAYS returns a valid array:

For Array, it might be a temp (bu valid) empty array.

For Array.Range, the range is already sliced and validated between _a and _b.

From there, the call implementations are nothing more than a forward the call's op to returned array. This makes any and all asserts superfluous, as the array will assert just as well, with as much verbosity, and at the point of call anyways.

2.
When creating a range, after the range is created, if the payload is not initialized, then the range will initialize it just for itself. This should make the range operations faster, as they won't be checking isInitialized on every call. This is especially important for "empty", for example, for which not having an initialized payload is valid.

3.
Oh yeah, and Range now carries a Data, rather than a Array, but that changes nothing at all actually.