From: Tara L Andrews Date: Mon, 1 Oct 2012 04:36:29 +0000 (+0200) Subject: tweak relationship application order X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d782dc180db8873a32f56679f9bf9777d4a17550;p=scpubgit%2Fstemmatology.git tweak relationship application order --- diff --git a/base/lib/Text/Tradition/Parser/Self.pm b/base/lib/Text/Tradition/Parser/Self.pm index 2e5425d..dbf3ece 100644 --- a/base/lib/Text/Tradition/Parser/Self.pm +++ b/base/lib/Text/Tradition/Parser/Self.pm @@ -320,11 +320,12 @@ sub _apply_relationship_order { # Apply strong relationships before weak return -1 if $bt->is_weak && !$at->is_weak; return 1 if $at->is_weak && !$bt->is_weak; + # Apply more tightly bound relationships first + my $blcmp = $at->bindlevel <=> $bt->bindlevel; + return $blcmp if $blcmp; # Apply local before global return -1 if $a->{scope} eq 'local' && $b->{scope} ne 'local'; return 1 if $b->{scope} eq 'local' && $a->{scope} ne 'local'; - # Apply more tightly bound relationships first - return $at->bindlevel <=> $bt->bindlevel; } 1;