mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
cgen: omit "x ~mod+= y ~mod* 0"
This commit is contained in:
1 parent
1f3df26c7f
commit
40f39a3ba3
5 files changed
+22
-235
No files matched your search
@@ -127,6 +127,13 @@ func (g *gen) writeStatementAssign1(b *buffer, op t.ID, lhs *a.Expr, rhs *a.Expr
|
||||
lhsBuf := buffer(nil)
|
||||
opName, closer, disableWconversion := "", "", false
|
||||
|
||||
switch op {
|
||||
case t.IDPlusEq, t.IDMinusEq, t.IDTildeModPlusEq, t.IDTildeModMinusEq:
|
||||
if rhs.MBounds().IsJustZero() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if lhs != nil {
|
||||
if err := g.writeExpr(&lhsBuf, lhs, false, 0); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user