Change all uses of x = x.successor() to use x._successorInPlace()

...because it is apparently more efficient in some cases.  Technically
we don't do this in ALL places, because it would be unfortunate if
the implementation of _successorInPlace() were self recursive :-)
This commit is contained in:
Chris Lattner
2015-12-16 22:38:37 -08:00
parent 0bfacde242
commit 99fcb2dfe1
9 changed files with 22 additions and 22 deletions

View File

@@ -143,9 +143,9 @@ extension String.CharacterView : CollectionType {
var gcb0 = graphemeClusterBreakProperty.getPropertyRawValue(
unicodeScalars[start].value)
start = start.successor()
start._successorInPlace()
for ; start != end; start = start.successor() {
for ; start != end; start._successorInPlace() {
// FIXME(performance): consider removing this "fast path". A branch
// that is hard to predict could be worse for performance than a few
// loads from cache to fetch the property 'gcb1'.