Skip to content

Commit

Permalink
Remove redundant checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Dec 1, 2023
1 parent 913993c commit cafdd41
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,9 +1015,6 @@ func hasCommand(commands []*Command, command *Command) bool {
}

func (cmd *Command) runFlagActions(ctx context.Context) error {
if cmd.flagSet == nil {
return nil
}

for _, fl := range cmd.appliedFlags {
isSet := false
Expand All @@ -1042,10 +1039,8 @@ func (cmd *Command) runFlagActions(ctx context.Context) error {
if !fl.IsSet() {
continue
}
if fl.IsSet() {
if pf, ok := fl.(PersistentFlag); ok && pf.IsPersistent() {
continue
}
if pf, ok := fl.(PersistentFlag); ok && pf.IsPersistent() {
continue
}
}

Expand Down

0 comments on commit cafdd41

Please sign in to comment.