Skip to content

Commit 9bc6aad

Browse files
Updating how String can be casted into an Array.
Just wanted to update the syntax from Array(self.characters) to Array(self). Similarly for casting of the ptnr String.
1 parent 9aa3608 commit 9bc6aad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Knuth-Morris-Pratt/KnuthMorrisPratt.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ extension String {
1212

1313
func indexesOf(ptnr: String) -> [Int]? {
1414

15-
let text = Array(self.characters)
16-
let pattern = Array(ptnr.characters)
15+
let text = Array(self)
16+
let pattern = Array(ptnr)
1717

1818
let textLength: Int = text.count
1919
let patternLength: Int = pattern.count

0 commit comments

Comments
 (0)