Skip to content

Commit

Permalink
chore: staticcheck cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
proullon committed Jan 19, 2024
1 parent a212ff6 commit 8f4341e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion engine/agnostic/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (t *Transaction) rollbackValueChange(c ValueChange) {
if c.current != nil && c.old != nil {
cur := c.current.Value.(*Tuple)
old := c.old.Value.(*Tuple)
for i, _ := range cur.values {
for i := range cur.values {
cur.values[i] = old.values[i]
}
}
Expand Down
4 changes: 2 additions & 2 deletions engine/agnostic/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (r *Relation) CheckPrimaryKey(tuple *Tuple) (bool, error) {
}

var index Index
for i, _ := range r.indexes {
for i := range r.indexes {
if strings.HasPrefix(r.indexes[i].Name(), "pk") {
index = r.indexes[i]
break
Expand Down Expand Up @@ -135,7 +135,7 @@ func (r *Relation) Truncate() int64 {
return int64(l)
}

func (r Relation) String() string {
func (r *Relation) String() string {
if r.schema != "" {
return r.schema + "." + r.name
}
Expand Down
4 changes: 1 addition & 3 deletions engine/agnostic/tuple.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ type Tuple struct {
func NewTuple(values ...any) *Tuple {
t := &Tuple{}

for _, v := range values {
t.values = append(t.values, v)
}
t.values = append(t.values, values...)
return t
}

Expand Down
2 changes: 1 addition & 1 deletion engine/parser/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func (l *lexer) MatchEscapedStringToken() bool {
escaped := l.instruction[l.pos+2 : i-1]

for _, r := range escaped {
if unicode.IsDigit(rune(r)) == false {
if !unicode.IsDigit(rune(r)) {
tok = StringToken
}
}
Expand Down
2 changes: 1 addition & 1 deletion engine/parser/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (p *parser) parseSelect(tokens []Token) (*Instruction, error) {
}
hazWhereClause = true
case OrderToken:
if hazWhereClause == false {
if !hazWhereClause {
// WHERE clause is implicit
addImplicitWhereAll(selectDecl)
}
Expand Down

0 comments on commit 8f4341e

Please sign in to comment.