Skip to content

Commit

Permalink
expand: simplify ValidName arithmetic loop
Browse files Browse the repository at this point in the history
syntax.ValidName now returns false on empty strings, as it should - so
the logic here can be cleaned up.
  • Loading branch information
mvdan committed Jan 7, 2019
1 parent e3c5ce0 commit 23a244e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion expand/arith.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Arithm(cfg *Config, expr syntax.ArithmExpr) (int, error) {
}
// recursively fetch vars
i := 0
for str != "" && syntax.ValidName(str) {
for syntax.ValidName(str) {
val := cfg.envGet(str)
if val == "" {
break
Expand Down

0 comments on commit 23a244e

Please sign in to comment.