Skip to content

Commit

Permalink
Prefer guard ... else { continue } to if ... { continue }
Browse files Browse the repository at this point in the history
  • Loading branch information
hydhknn committed Jan 18, 2017
1 parent 772b7e9 commit 356f4c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/JSONParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public struct JSONParser {
switch input[loc] {
case Literal.BACKSLASH:
loc = (loc + 1)
if loc >= input.count { continue }
guard loc < input.count else { continue }
switch input[loc] {
case Literal.DOUBLE_QUOTE: stringDecodingBuffer.append(Literal.DOUBLE_QUOTE)
case Literal.BACKSLASH: stringDecodingBuffer.append(Literal.BACKSLASH)
Expand Down

0 comments on commit 356f4c3

Please sign in to comment.