mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-11 14:45:31 +03:00
cli/command: remove redundant nil check
From the Go specification: "1. For a nil slice, the number of iterations is 0." [1] Therefore, an additional nil check for before the loop is unnecessary. [1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
parent
a6a2a5b6e6
commit
77563cebb0
@ -417,12 +417,9 @@ func (self *Command) FindOptions(name_with_hyphens string) []*Option {
|
||||
depth := 0
|
||||
for p := self.Parent; p != nil; p = p.Parent {
|
||||
depth++
|
||||
x := p.FindOptions(name_with_hyphens)
|
||||
if x != nil {
|
||||
for _, po := range x {
|
||||
if po.Depth >= depth {
|
||||
ans = append(ans, po)
|
||||
}
|
||||
for _, po := range p.FindOptions(name_with_hyphens) {
|
||||
if po.Depth >= depth {
|
||||
ans = append(ans, po)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user