Skip to content

Commit

Permalink
do not use force unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka committed Sep 27, 2018
1 parent ab4b136 commit 3f725c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Tokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ extension String {
} else if specialCharacters.contains(word) {
components[components.count-1] += word
} else if word != "(" && word.hasPrefix("(") || word != ")" && word.hasPrefix(")") {
components.append(String(word.first!))
components.append(String(word[0]))
appendWord(String(word.dropFirst()))
} else if word != "(" && word.hasSuffix("(") || word != ")" && word.hasSuffix(")") {
appendWord(String(word.dropLast()))
components.append(String(word.last!))
components.append(String(word.suffix(1)))
} else {
components.append(word)
}
Expand Down

0 comments on commit 3f725c7

Please sign in to comment.