@@ -185,7 +185,7 @@ final class Pattern {
185185 // is relaxed, more strict check is performed in \c EvaluateExpression.
186186 var isExpression = false
187187 let diagLoc = CheckLocation . inBuffer ( pattern. baseAddress!, buf)
188- for (i, c) in name. characters . enumerated ( ) {
188+ for (i, c) in name. enumerated ( ) {
189189 if i == 0 && c == " @ " {
190190 if nameEnd != nil {
191191 diagnose ( . error, at: diagLoc, with: " invalid name in named regex definition " , options: options)
@@ -217,7 +217,7 @@ final class Pattern {
217217 }
218218 self . addBackrefToRegEx ( varParenNum)
219219 } else {
220- variableUses. append ( ( name, self . regExPattern. characters . count) )
220+ variableUses. append ( ( name, self . regExPattern. count) )
221221 }
222222 continue
223223 }
@@ -270,7 +270,7 @@ final class Pattern {
270270 return nil
271271 }
272272 expr = String ( expr [ expr. index ( expr. startIndex, offsetBy: " @LINE " . utf8. count) ... ] )
273- guard let firstC = expr. characters . first else {
273+ guard let firstC = expr. first else {
274274 return " \( self . lineNumber) "
275275 }
276276
@@ -295,7 +295,7 @@ final class Pattern {
295295 for (v, offset) in self . variableUses {
296296 var value : String = " "
297297
298- if let c = v. characters . first, c == " @ " {
298+ if let c = v. first, c == " @ " {
299299 guard let v = self . evaluateExpression ( v) else {
300300 return nil
301301 }
@@ -310,7 +310,7 @@ final class Pattern {
310310 }
311311
312312 // Plop it into the regex at the adjusted offset.
313- regExToMatch. insert ( contentsOf: value. characters , at: regExToMatch. index ( regExToMatch. startIndex, offsetBy: offset + insertOffset) )
313+ regExToMatch. insert ( contentsOf: value, at: regExToMatch. index ( regExToMatch. startIndex, offsetBy: offset + insertOffset) )
314314 insertOffset += value. utf8. count
315315 }
316316 }
@@ -385,7 +385,7 @@ final class Pattern {
385385 // [...] Nesting depth
386386 var bracketDepth = 0
387387
388- while let firstChar = string. characters . first {
388+ while let firstChar = string. first {
389389 if string. hasPrefix ( terminator) && bracketDepth == 0 {
390390 return offset
391391 }
0 commit comments