Skip to content

Commit

Permalink
just use two lines
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 17, 2015
1 parent 5366665 commit cd83dc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Mojo/DOM/CSS.pm
Expand Up @@ -188,9 +188,9 @@ sub _pc {
}

# ":only-*"
elsif ($class =~ /^only-(?:child|(of-type))$/) {
$_ ne $current and return undef
for @{_siblings($current, $1 ? $current->[1] : undef)};
elsif ($class eq 'only-child' || $class eq 'only-of-type') {
my $type = $class eq 'only-of-type' ? $current->[1] : undef;
$_ ne $current and return undef for @{_siblings($current, $type)};
return 1;
}

Expand Down

0 comments on commit cd83dc2

Please sign in to comment.