From: Vincent Pit Date: Sun, 18 Jul 2010 12:28:46 +0000 (+0200) Subject: The ->tag must be defined for a Mod, so simplify covering resolution X-Git-Tag: v0.01~51 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLaTeX-TikZ.git;a=commitdiff_plain;h=3b88cebc88df4db88d0d43256c2d49ffb324cda7 The ->tag must be defined for a Mod, so simplify covering resolution --- diff --git a/lib/LaTeX/TikZ/Set/Mod.pm b/lib/LaTeX/TikZ/Set/Mod.pm index e98b98a..f759b0d 100644 --- a/lib/LaTeX/TikZ/Set/Mod.pm +++ b/lib/LaTeX/TikZ/Set/Mod.pm @@ -88,14 +88,10 @@ MOD: for my $mod ($set->mods) { $has_layer = 1 if $ltml_tc->check($mod); my $tag = $mod->tag; - my @candidates; - if (defined $tag) { - my $old = $mods{$tag}; - @candidates = $old ? map $_->[0], @$old : (); - } else { - @candidates = values %mods; + my $old = $mods{$tag} || []; + for (@$old) { + next MOD if $_->[0]->cover($mod); } - $_->cover($mod) and next MOD for @candidates; push @{$mods{$tag}}, [ $mod, $last_mod++ ]; push @mods, $mod; }