mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] No need to use max_by when array.size == 1
https://github.com/ruby/reline/commit/7e56c8af05
This commit is contained in:
parent
8913b9b742
commit
d07060c42a
1 changed files with 2 additions and 2 deletions
|
@ -70,8 +70,8 @@ class Reline::KeyStroke
|
|||
key_mapping.keys.select { |lhs|
|
||||
lhs.start_with? input
|
||||
}.tap { |it|
|
||||
return :matched if it.size == 1 && (it.max_by(&:size)&.== input)
|
||||
return :matching if it.size == 1 && (it.max_by(&:size)&.!= input)
|
||||
return :matched if it.size == 1 && (it[0] == input)
|
||||
return :matching if it.size == 1 && (it[0] != input)
|
||||
return :matched if it.max_by(&:size)&.size&.< input.size
|
||||
return :matching if it.size > 1
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue