Skip to content

Commit

Permalink
create a new slice, just a matter of preference
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach committed Nov 6, 2024
1 parent 02b6c9b commit 270c0d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/vt/schema/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ func parseEnumOrSetTokens(env *vtenv.Environment, enumOrSetValues string) ([]str
return nil, unexpectedError()
}
enumValues := addColumn.Columns[0].Type.EnumValues
decodedEnumValues := make([]string, len(enumValues))
for i := range enumValues {
val, err := sqltypes.DecodeStringSQL(enumValues[i])
if err != nil {
return nil, err
}
enumValues[i] = val
decodedEnumValues[i] = val
}
return enumValues, nil
return decodedEnumValues, nil
}

// ParseEnumOrSetTokensMap parses the comma delimited part of an enum column definition
Expand Down

0 comments on commit 270c0d5

Please sign in to comment.