Skip to content

Commit 1a2687a

Browse files
committed
[Foundation] Convert Data’s SubSequence type to be Data
Data can encapsulate it’s own sub-sequence type by housing a range of the slice in the structural type for Data. By doing this it avoids the API explosion of supporting all APIs that take Data would need overloads to take a slice of Data. This does come at a small conceptual cost: any index based iteration should always account for the startIndex and endIndex of the Data (which was an implicit requirement previously by being a Collection). Moreover this prevents the requirement of O(n) copies of Data if it is never mutated while parsing sub sequences; so more than an API amelioration this also could offer a more effecient code-path for applications to use.
1 parent 8bdc8ec commit 1a2687a

File tree

3 files changed

+173
-119
lines changed

3 files changed

+173
-119
lines changed

0 commit comments

Comments
 (0)