Add significant weight to non-direct type matches

This commit is contained in:
Chris Roberts 2021-11-17 14:51:20 -08:00 committed by Paul Hinze
parent 4e60160797
commit 0e8ded18aa
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -203,7 +203,7 @@ module VagrantPlugins
w = edges.map(&:weight).inject(&:+)
if edges.first.respond_to?(:type) && edges.last.respond_to?(:type)
if edges.first.type != edges.last.type
w += 1
w += 200
extra = edges.first.type.ancestors.index(edges.last.type)
if extra.nil?
extra = edges.last.type.ancestors.index(edges.first.type)