]> Cypherpunks.ru repositories - gostls13.git/commitdiff
flag: remove "// BUG" comment
authorZamicol <zamicol@gmail.com>
Fri, 14 Oct 2022 03:10:28 +0000 (03:10 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 17 Oct 2022 14:50:31 +0000 (14:50 +0000)
Remove a vestigial " // BUG" comment as there is no bug in the relevant code section and comment predated other changes.  Also removed a needless allocation and conformed to the "v, ok := a[x]" standard convention.  Tests are passing.

Change-Id: Id28ad1baf77447052b54b341f018e573bac0c11a
GitHub-Last-Rev: 26084698bfc0972d7e0fec0de4f31cc87e3a5f7a
GitHub-Pull-Request: golang/go#56210
Reviewed-on: https://go-review.googlesource.com/c/go/+/442815
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/flag/flag.go

index f6b38908f6d7e90af49bb8b7aaff4c100d6719d7..ef3cf29c0c5452ea5d11c35c299e5dbcfc664ada 100644 (file)
@@ -1056,9 +1056,9 @@ func (f *FlagSet) parseOne() (bool, error) {
                        break
                }
        }
-       m := f.formal
-       flag, alreadythere := m[name] // BUG
-       if !alreadythere {
+
+       flag, ok := f.formal[name]
+       if !ok {
                if name == "help" || name == "h" { // special case for nice help message.
                        f.usage()
                        return false, ErrHelp