]> Cypherpunks repositories - gostls13.git/commitdiff
go/internal/gccgoimporter: remove guard on some assertions
authorThan McIntosh <thanm@google.com>
Tue, 10 Sep 2019 18:42:50 +0000 (14:42 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 10 Sep 2019 19:57:03 +0000 (19:57 +0000)
Remove unnecessary conditional guard for a couple of assertions in the
type parser's update() method (inspired by comment from Robert). No
change in functionality.

Change-Id: I706a54569e75c6960768247889b7dec3f267dde9
Reviewed-on: https://go-review.googlesource.com/c/go/+/194565
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/internal/gccgoimporter/parser.go

index c089b5e054177f81e743898049cb258075c7395c..9204b004f9b7e6084b076c21ee425c5dc9108b7e 100644 (file)
@@ -475,13 +475,11 @@ func (p *parser) reserve(n int) {
 // used to resolve pointers to named types in case they are referenced
 // by embedded fields.
 func (p *parser) update(t types.Type, nlist []interface{}) {
-       if len(nlist) != 0 {
-               if t == reserved {
-                       p.errorf("internal error: update(%v) invoked on reserved", nlist)
-               }
-               if t == nil {
-                       p.errorf("internal error: update(%v) invoked on nil", nlist)
-               }
+       if t == reserved {
+               p.errorf("internal error: update(%v) invoked on reserved", nlist)
+       }
+       if t == nil {
+               p.errorf("internal error: update(%v) invoked on nil", nlist)
        }
        for _, n := range nlist {
                switch n := n.(type) {