Use less literals to implement Mutant::Context::Scope#match_prefixes

This commit is contained in:
Markus Schirp 2013-08-05 09:18:37 +02:00
parent 97ba65f7bb
commit 648bfd5e66
2 changed files with 3 additions and 3 deletions

View file

@ -1,3 +1,3 @@
--- ---
threshold: 16 threshold: 16
total_score: 738 total_score: 733

View file

@ -96,8 +96,8 @@ module Mutant
# @api private # @api private
# #
def match_prefixes def match_prefixes
name_nesting.length.downto(1).map do |last| name_nesting.each_index.reverse_each.map do |index|
name_nesting[0...last].join('::') name_nesting.take(index.succ).join('::')
end end
end end
memoize :match_prefixes memoize :match_prefixes