From: Zamicol Date: Fri, 14 Oct 2022 03:10:28 +0000 (+0000) Subject: flag: remove "// BUG" comment X-Git-Tag: go1.20rc1~623 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9abcc487f8b04db8fd46eaa429a7eef5a5228241;p=gostls13.git flag: remove "// BUG" comment 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 Reviewed-by: David Chase Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Rob Pike TryBot-Result: Gopher Robot --- diff --git a/src/flag/flag.go b/src/flag/flag.go index f6b38908f6..ef3cf29c0c 100644 --- a/src/flag/flag.go +++ b/src/flag/flag.go @@ -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