mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-12 09:09:39 +01:00
Clean up _extendComplex by removing a variable.
This commit is contained in:
parent
c006fd8f14
commit
454171d7a0
@ -235,7 +235,6 @@ class Extender {
|
|||||||
{bool replace: false}) {
|
{bool replace: false}) {
|
||||||
// This could be written more simply using [List.map], but we want to avoid
|
// This could be written more simply using [List.map], but we want to avoid
|
||||||
// any allocations in the common case where no extends apply.
|
// any allocations in the common case where no extends apply.
|
||||||
var changed = false;
|
|
||||||
List<List<ComplexSelector>> extendedNotExpanded;
|
List<List<ComplexSelector>> extendedNotExpanded;
|
||||||
for (var i = 0; i < complex.components.length; i++) {
|
for (var i = 0; i < complex.components.length; i++) {
|
||||||
var component = complex.components[i];
|
var component = complex.components[i];
|
||||||
@ -243,33 +242,26 @@ class Extender {
|
|||||||
var extended = _extendCompound(component, extensions, mediaQueryContext,
|
var extended = _extendCompound(component, extensions, mediaQueryContext,
|
||||||
replace: replace);
|
replace: replace);
|
||||||
if (extended == null) {
|
if (extended == null) {
|
||||||
if (changed) {
|
extendedNotExpanded?.add([
|
||||||
extendedNotExpanded.add([
|
|
||||||
new ComplexSelector([component])
|
new ComplexSelector([component])
|
||||||
]);
|
]);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (!changed) {
|
extendedNotExpanded ??= complex.components
|
||||||
extendedNotExpanded = complex.components
|
|
||||||
.take(i)
|
.take(i)
|
||||||
.map((component) => [
|
.map((component) => [
|
||||||
new ComplexSelector([component],
|
new ComplexSelector([component],
|
||||||
lineBreak: complex.lineBreak)
|
lineBreak: complex.lineBreak)
|
||||||
])
|
])
|
||||||
.toList();
|
.toList();
|
||||||
}
|
|
||||||
changed = true;
|
|
||||||
extendedNotExpanded.add(extended);
|
extendedNotExpanded.add(extended);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (changed) {
|
extendedNotExpanded?.add([
|
||||||
extendedNotExpanded.add([
|
|
||||||
new ComplexSelector([component])
|
new ComplexSelector([component])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (extendedNotExpanded == null) return null;
|
||||||
if (!changed) return null;
|
|
||||||
|
|
||||||
var first = true;
|
var first = true;
|
||||||
return paths(extendedNotExpanded).map((path) {
|
return paths(extendedNotExpanded).map((path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user