@@ -175,51 +175,6 @@ extension String {
175175
176176 return result
177177 }
178-
179- func firstMatch(
180- of match: Self ,
181- at startIndex: Self . Index
182- ) -> ( start: Self . Index , end: Self . Index ) ? {
183- guard !match. isEmpty else { return nil }
184- guard match. count <= self . count else { return nil }
185-
186- var startIndex = startIndex
187- while startIndex < self . endIndex {
188- // Check if theres a match.
189- if let endIndex = self . matches ( match, at: startIndex) {
190- // Return the match.
191- return ( startIndex, endIndex)
192- }
193-
194- // Move to the next of index.
195- self . formIndex ( after: & startIndex)
196- }
197-
198- return nil
199- }
200-
201- func matches(
202- _ match: Self ,
203- at startIndex: Self . Index
204- ) -> Self . Index ? {
205- var selfIndex = startIndex
206- var matchIndex = match. startIndex
207-
208- while true {
209- // Only continue checking if there is more match to check
210- guard matchIndex < match. endIndex else { return selfIndex }
211-
212- // Exit early if there is no more "self" to check.
213- guard selfIndex < self . endIndex else { return nil }
214-
215- // Check match and self are the the same.
216- guard self [ selfIndex] == match [ matchIndex] else { return nil }
217-
218- // Move to the next pair of indices.
219- self . formIndex ( after: & selfIndex)
220- match. formIndex ( after: & matchIndex)
221- }
222- }
223178}
224179
225180extension CommandInfoV0 {
0 commit comments