lib/sass/selector/simple.rb in sass-3.4.12 vs lib/sass/selector/simple.rb in sass-3.4.13
- old
+ new
@@ -70,15 +70,12 @@
# by the time extension and unification happen,
# this exception will only ever be raised as a result of programmer error
def unify(sels)
return sels if sels.any? {|sel2| eql?(sel2)}
sels_with_ix = Sass::Util.enum_with_index(sels)
- _, i =
- if is_a?(Pseudo)
- sels_with_ix.find {|sel, _| sel.is_a?(Pseudo) && (sels.last.type == :element)}
- else
- sels_with_ix.find {|sel, _| sel.is_a?(Pseudo)}
- end
+ if !is_a?(Pseudo) || (sels.last.is_a?(Pseudo) && sels.last.type == :element)
+ _, i = sels_with_ix.find {|sel, _| sel.is_a?(Pseudo)}
+ end
return sels + [self] unless i
sels[0...i] + [self] + sels[i..-1]
end
protected