Inserting and removing a single Unicode.Scalar in a CharacterSet must not
attempt to create a Range<Unicode.Scalar> because the upperBound value might
not always be a valid UnicodeScalar.
This fixes a regression to the fix for SR-2988.
Some cases of using isSuperset can cause crashes, this was caused by improper subclassing callouts; this pr resolves those failures (and provides unit tests for that case)
The cases where the bridge was traversed too much now only causes a single bridge out call (without needing to reallocate or thrash retain/release)
String.components(separatedBy: CharacterSet) should be considerably faster now not only for more apporpriate bridging calls but also no longer needing to bridge arrays back and forth.
Resolves the following issues:
rdar://problem/17281998
rdar://problem/26611771
rdar://problem/29738989
When inserting a closed range/creating a CharacterSet from a closed
range we must not try to convert this range to a half open one by
incrementing the upperBound UnicodeScalar because not all integer values
are valid values for UnicodeScalar
Fixes SR-2988
* Implement CharacterSet.subtracting(_:)
* Add test for CharacterSet.subtract(_:)
* Expand on test for CharacterSet.subtract(_:)
* Address reviewer comment (CharacterSet tests)
* Improve documentation for CharacterSet set algebra