* [stdlib] Remove MutableCollection.sorted methods
This removes the implementations of sorted() and sorted(by:) on Mutable-
Collection, which only changed some minor wording in the docs.
This also adds documentation to the partition(by:) implementations so that
they will appear downstream.
* [stdlib] De-gyb CollectionAlgorithms.swift
* Update tests for MutableCollection.sorted() changes
"Capacity" in the public Set/Dictionary API means the maximum number of items that a collection instance may hold without reallocation. In implementation details, the same word was also used for the capacity of the underlying storage buffer, which is usually higher due to the maximum load factor.
Having the same name for two different values has led to bugs where the logical/effective capacity is passed directly to a function expecting the raw storage capacity, or vice versa. This change updates internal names to clearly distinguish between the two senses, introducing "bucketCount" as the name for the storage buffer capacity, and reserving "capacity" for the maximum logical item count.
As pointed out in Ole Begeman's blog:
https://oleb.net/blog/2016/09/playground-print-hook/
The playground print hook is being initialized a a non-null noop hook,
which causes the fast paths in the print functions to be unused, and
forcing the creation of a tee stream for things that have nothing to
do with playgrounds. It is sad that no one noticed this...
This is a temporary workaround for some situations where the empty
singleton is not being formed correctly (and this seems to be highly
configuration dependent). Work around that for now for also checking
for empty non-storage-backed Strings.
This is probably too expensive a check for us to do long-term, but it
works for now.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
In grand LLVM tradition, the first step to redesigning _StringCore is
to first rename it to _LegacyStringCore. Subsequent commits will
introduce the replacement, and eventually all uses of the old one will
be moved to the new one.
NFC.
Partial revert of 26f6a751c4.
Removing this breaks bridging these values to Objective C. Once IUOs
are removed from the type system and ImplicitlyUnwrappedOptional<T> is
removed from the library, we'll be strictly using Optional<T> which
has this conformance as well.
Fixes: rdar://problem/36477954, https://bugs.swift.org/browse/SR-6764
* Remove a bunch of Default(Bidirectional|RandomAccess)Indices usage from stdlib and test
* Remove some DefaultRandomAccessIndices and IndexDistance usage from Foundation
* Remove no-longer-used internal type in Existentials.swift
* Get rid of indicesForTraversal
Extend _typeByMangledName with support for user-provided type parameter
substitutions, where type parameters that occur in the mangling can be
replaced with specific types.
_getTypeByMangledName() is more general and will be the way forward. Use
that instead. Note that we're still keeping around Foundation-only SPI
function _typeByName() in the Swift standard library, until we settle
on what the standard library API should be like for this functionality.