Skip to content

Commit 5c7ec27

Browse files
authored
Merge pull request #936 from RobertoEfrainHernandez/patch-1
Updating how String can be casted into an Array.
2 parents bc6d768 + 9bc6aad commit 5c7ec27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Knuth-Morris-Pratt/KnuthMorrisPratt.swift

Lines changed: 2 additions & 2 deletions
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)