mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 22:02:00 +01:00
Use whereType() to avoid a cast
This commit is contained in:
parent
7b3a2adc12
commit
66c2c26a7e
@ -784,12 +784,5 @@ bool _selectorPseudoIsSuperselector(
|
||||
/// and that have the given [name].
|
||||
Iterable<PseudoSelector> _selectorPseudosNamed(
|
||||
CompoundSelector compound, String name) =>
|
||||
// TODO(nweiz): Use whereType() when we only have to support Dart 2 runtime
|
||||
// semantics.
|
||||
compound.components
|
||||
.where((pseudo) =>
|
||||
pseudo is PseudoSelector &&
|
||||
pseudo.isClass &&
|
||||
pseudo.selector != null &&
|
||||
pseudo.name == name)
|
||||
.cast();
|
||||
compound.components.whereType<PseudoSelector>().where((pseudo) =>
|
||||
pseudo.isClass && pseudo.selector != null && pseudo.name == name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user