D-Programming-Language/phobos — pull request #809 by monarchdodra (2012-09-21 06:39:36+00:00)
Title: Consolidating Array

These 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.

EDIT: close and re-opened because I suck with git.