mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: fix mirrors for UTF8 and UTF16 String views so that they actually work
instead of causing a stack overflow rdar://17897212 Swift SVN r20974
This commit is contained in:
@@ -26,9 +26,9 @@ extension String {
|
||||
|
||||
var count: Int { return distance(_value.startIndex,_value.endIndex) }
|
||||
|
||||
subscript(i: Int) -> (String,MirrorType) {
|
||||
subscript(i: Int) -> (String, MirrorType) {
|
||||
_precondition(i >= 0 && i < count, "MirrorType access out of bounds")
|
||||
return ("[\(i)]", reflect(self[i]))
|
||||
return ("[\(i)]", reflect(_value[advance(_value.startIndex, i)]))
|
||||
}
|
||||
|
||||
var summary: String { return String(_value._core) }
|
||||
|
||||
Reference in New Issue
Block a user