Permalink
Browse files

Refactor VersionSpace#specialize.

  • Loading branch information...
1 parent 781a553 commit b9c2409652596f2cd32b9ca38b20aae2b9ebd9ca @arthurschreiber committed Apr 12, 2011
Showing with 1 addition and 3 deletions.
  1. +1 −3 ruby/lib/version_space.rb
@@ -95,9 +95,7 @@ def get_potential_positions(g, neg, s)
def specialize(g, neg, s)
get_potential_positions(g, neg, s).map do |index|
if g[index] == :*
- copy = g.dup
- copy[index] = s[index]
- copy
+ g.dup.tap { |copy| copy[index] = s[index] }
end
end
end

0 comments on commit b9c2409

Please sign in to comment.