Skip to content

Commit

Permalink
Merge pull request #376 from Quasilyte/quasilyte/assignOp
Browse files Browse the repository at this point in the history
simplify assignments with <op>= syntax
  • Loading branch information
chris-ramon authored Jul 31, 2018
2 parents 0403491 + 88db909 commit 5c1be08
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchutil/wide_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func generateFieldNameFromX(x int) string {
for {
r := v % 10
out = alphabet[r] + out
v = v / 10
v /= 10
if v == 0 {
break
}
Expand Down
2 changes: 1 addition & 1 deletion language/visitor/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func Visit(root ast.Node, visitorOpts *VisitorOptions, keyMap KeyMap) interface{
// abstract algorithm
Loop:
for {
index = index + 1
index++

isLeaving := (len(keys) == index)
var (
Expand Down
4 changes: 2 additions & 2 deletions rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func getSuggestedTypeNames(schema *Schema, ttype Output, fieldName string) []str
if index < len(suggestedInterfaces) {
s := suggestedInterfaces[index]
if s.name == possibleInterface.Name() {
s.count = s.count + 1
s.count++
}
}
}
Expand Down Expand Up @@ -782,7 +782,7 @@ func LoneAnonymousOperationRule(context *ValidationContext) *ValidationRuleInsta
operationCount = 0
for _, definition := range node.Definitions {
if definition.GetKind() == kinds.OperationDefinition {
operationCount = operationCount + 1
operationCount++
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion testutil/rules_test_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ func ExpectPassesRuleWithSchema(t *testing.T, schema *graphql.Schema, rule graph
}
func RuleError(message string, locs ...int) gqlerrors.FormattedError {
locations := []location.SourceLocation{}
for i := 0; i < len(locs); i = i + 2 {
for i := 0; i < len(locs); i += 2 {
line := locs[i]
col := 0
if i+1 < len(locs) {
Expand Down

0 comments on commit 5c1be08

Please sign in to comment.