Skip to content

Commit

Permalink
slightly more consistent arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 14, 2015
1 parent 58d601c commit 4f5f966
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Mojo/DOM/CSS.pm
Expand Up @@ -24,7 +24,7 @@ sub select { _select(0, shift->tree, _compile(@_)) }
sub select_one { _select(1, shift->tree, _compile(@_)) }

sub _ancestor {
my ($selectors, $current, $tree, $pos, $one) = @_;
my ($selectors, $current, $tree, $one, $pos) = @_;

while ($current = $current->[3]) {
return undef if $current->[0] eq 'root' || $current eq $tree;
Expand Down Expand Up @@ -59,7 +59,7 @@ sub _combinator {
}

# ">" (parent only)
return _ancestor($selectors, $current, $tree, ++$pos, 1) if $c eq '>';
return _ancestor($selectors, $current, $tree, 1, ++$pos) if $c eq '>';

# "~" (preceding siblings)
return _sibling($selectors, $current, $tree, 0, ++$pos) if $c eq '~';
Expand All @@ -68,7 +68,7 @@ sub _combinator {
return _sibling($selectors, $current, $tree, 1, ++$pos) if $c eq '+';

# " " (ancestor)
return _ancestor($selectors, $current, $tree, ++$pos);
return _ancestor($selectors, $current, $tree, 0, ++$pos);
}

sub _compile {
Expand Down

0 comments on commit 4f5f966

Please sign in to comment.