mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Remove unnecessary check for "var b bool = x".
This commit is contained in:
1 parent
8cd43d2c3c
commit
aed3aa9925
2 files changed
+3
-7
No files matched your search
@@ -931,7 +931,7 @@ func (g *gen) writeExpr(n *a.Expr, rp replacementPolicy, pp parenthesesPolicy, d
|
||||
}
|
||||
|
||||
if cv := n.ConstValue(); cv != nil {
|
||||
if nTyp := n.MType(); nTyp.PackageOrDecorator() != 0 || nTyp.Name().Key() != t.KeyBool {
|
||||
if !n.MType().IsBool() {
|
||||
g.writes(cv.String())
|
||||
} else if cv.Cmp(zero) == 0 {
|
||||
g.writes("false")
|
||||
|
||||
Reference in new issue
Block a user