Skip to content

Commit

Permalink
remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Aug 20, 2017
1 parent f5d481f commit 6fb9e7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ enum SwiftIdentifier {
static func prefixWithUnderscoreIfNeeded(string: String,
forbiddenChars exceptions: String = "") -> String {

let (head, tail) = identifierCharacterSets(exceptions: exceptions)
let (head, _) = identifierCharacterSets(exceptions: exceptions)

let chars = string.unicodeScalars
let firstChar = chars[chars.startIndex]
let prefix = !head.longCharacterIsMember(firstChar.value) && tail.longCharacterIsMember(firstChar.value) ? "_" : ""
let prefix = !head.longCharacterIsMember(firstChar.value) ? "_" : ""

return prefix + string
}
Expand Down

0 comments on commit 6fb9e7a

Please sign in to comment.