Add a default implementation for CollectionTypes where their SubSequence
== Self. That is, mainly, Slice and ArraySlice. This changes the slice's
view of, but not modifying or copying, the underlying collection.
rdar://problem/20302034
Swift SVN r30496
- De-underscore the API that takes an equatable separator, add doc
comment, and add a test for it.
- Add a test for the negative maxSplit case.
- Add lifetime tracker for isSeparator closure in the semantic test.
Swift SVN r30413
rdar://problem/21663830
Add the following new requirements to SequenceType with default implementations:
- dropFirst(n)
- dropLast(n)
- prefix(n)
- suffix(n)
- split(n)
In addition, provide specialized default implementations of these for CollectionTypes with forward, bidirectional, and random-access Index types where possible.
Add the following new requirements to CollectionType with default implementations:
- prefixThrough(n)
- prefixUpTo(n)
- suffixFrom(n)
- split() // isSeparator closure
Add the following convenience APIs:
- dropFirst() -> calls dropFirst(1)
- dropLast() -> calls dropLast(1)
Add a tentative underscored API:
- split() // takes Equatable separator.
Some APIs have undefined behavior when creating slices where the endpoints go beyond the bounds of the underlying collection. This will be fixed later by trapping creation of slices with invalid indices (rdar://problem/21822657).
Swift SVN r30371
The big one, though, is the use of 'lazy' in _masterThreadOneTrial.
Removing it takes the function from 62s to 2s on my machine.
That's rdar://problem/20875936.
Swift SVN r30292
Otherwise, the length of the sequence is in principle lost. If you know
you have a sequence of less than 100 elements, you still want to know
exactly how many elements you initialized from it.
Swift SVN r30104
This is a straight-up "oops". You could always get to these typealiases via
the protocol, but like the member requirements you should have to say so.
Swift SVN r29952
The way we pass and compose source locations, messages, etc. needs to be
brought under control before too many more tests get written. This is
the first step.
Swift SVN r29928
Remove these standard library types in favor of (T) -> () closures.
It was originally believed that generic optimizations would make these
types profitable, however:
// FIXME: Insert benchmarks here.
rdar://problem/21663799
Swift SVN r29927
Add a shared buffer to every range replaceable mutable collection to
track logical mutations, and invalidate all indices on every mutation.
Swift SVN r29917
- Clean up tests
- Create API-specific test structures with clearer labels
- Use `OpaqueValue`s in test collections
- Make tests non-generic to allow array literal declarations
- Remove some unused functions
- Test return values for mutating functions that return a value
- Add expect* test source locations
- Add _customRemoveLast ad-hoc default implementation for `removeLast`
- Add default implementation for reserveCapacity that does nothing.
Swift SVN r29905
ExtensibleCollectionType's operations can all be represented by the
primitive range replacement operation, so fold it into
RangeReplaceableCollectionType.
In addition, provide default implementations of
RangeReplaceableCollectionType's methods.
- New tests added for combinations of (static, generic) calls and
(default, custom) implementations.
- Mark free Swift functions as unavailable with a message to direct the
developer to the protocol methods.
- Mark ExtensibleCollectionType as available with a message added to
direct the developer to the right protocol.
rdar://problem/18220295
Swift SVN r29857
...instead of ObjectIdentifier, to wrap Any.Type, and add protocol
conformances. ObjectIdentifier doesn't print nicely, because there's
really no type information left, and TypeIdentifier makes for better
output when tests fail.
Swift SVN r29813