Skip to content

Commit

Permalink
Remove extraneous conditions from remove_comments (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga authored Jan 12, 2023
1 parent 66d7273 commit 5e45afd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions transformations/remove_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ charLoop:
case (input[i] == '/') && (i+1 < inputLen) && (input[i+1] == '*'):
incomment = true
i += 2
case (input[i] == '<') && (i+1 < inputLen) && (input[i+1] == '!') && (i+2 < inputLen) && (input[i+2] == '-') && (i+3 < inputLen) && (input[i+3] == '-') && !incomment:
case (input[i] == '<') && (i+3 < inputLen) && (input[i+1] == '!') && (input[i+2] == '-') && (input[i+3] == '-'):
incomment = true
i += 4
case (input[i] == '-') && (i+1 < inputLen) && (input[i+1] == '-') && !incomment:
case (input[i] == '-') && (i+1 < inputLen) && (input[i+1] == '-'):
input[i] = ' '
break charLoop
case input[i] == '#' && !incomment:
case input[i] == '#':
input[i] = ' '
break charLoop
default:
Expand All @@ -40,7 +40,7 @@ charLoop:
input[j] = input[i]
i++
j++
case (input[i] == '-') && (i+1 < inputLen) && (input[i+1] == '-') && (i+2 < inputLen) && (input[i+2] == '>'):
case (input[i] == '-') && (i+2 < inputLen) && (input[i+1] == '-') && (input[i+2] == '>'):
incomment = false
i += 3
input[j] = input[i]
Expand Down

0 comments on commit 5e45afd

Please sign in to comment.