Use less literals to implement Mutant::Context::Scope#match_prefixes
This commit is contained in:
parent
97ba65f7bb
commit
648bfd5e66
2 changed files with 3 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
threshold: 16
|
||||
total_score: 738
|
||||
total_score: 733
|
||||
|
|
|
@ -96,8 +96,8 @@ module Mutant
|
|||
# @api private
|
||||
#
|
||||
def match_prefixes
|
||||
name_nesting.length.downto(1).map do |last|
|
||||
name_nesting[0...last].join('::')
|
||||
name_nesting.each_index.reverse_each.map do |index|
|
||||
name_nesting.take(index.succ).join('::')
|
||||
end
|
||||
end
|
||||
memoize :match_prefixes
|
||||
|
|
Loading…
Reference in a new issue