Skip to content

Commit

Permalink
Favor unless over if for negative conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed May 13, 2023
1 parent 47bccee commit 50f67a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/t/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ def extract_mentioned_screen_names(text)
([a-zA-Z0-9_]{1,20}) # $3: Screen name
/ox

return [] if !text&.match?(at_signs)
return [] unless text&.match?(at_signs)

text.to_s.scan(valid_mentions).collect do |_, _, screen_name|
screen_name
Expand Down

0 comments on commit 50f67a6

Please sign in to comment.