Skip to content

Commit

Permalink
Disable unused sass 4.0 code-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Jun 17, 2019
1 parent 2c4b0c3 commit 3d61646
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
20 changes: 15 additions & 5 deletions src/extender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ namespace Sass {
// ##########################################################################
// Helper function to copy extension between maps
// ##########################################################################
void Extender::mapCopyExts(
// Seems only relevant for sass 4.0 modules
// ##########################################################################
/* void mapCopyExts(
ExtSelExtMap& dest,
const ExtSelExtMap& source)
{
Expand All @@ -271,7 +273,7 @@ namespace Sass {
}
}
}
}
} */
// EO mapCopyExts

// ##########################################################################
Expand Down Expand Up @@ -353,11 +355,13 @@ namespace Sass {
auto existingExtensions = extensionsByExtender.find(target);
if (existingExtensions != extensionsByExtender.end()) {
if (hasExistingExtensions && !existingExtensions->second.empty()) {
auto additionalExtensions =
// Seems only relevant for sass 4.0 modules
// auto additionalExtensions =
extendExistingExtensions(existingExtensions->second, newExtensionsByTarget);
if (!additionalExtensions.empty()) {
// Seems only relevant for sass 4.0 modules
/* if (!additionalExtensions.empty()) {
mapCopyExts(newExtensionsByTarget, additionalExtensions);
}
} */
}
}

Expand Down Expand Up @@ -455,6 +459,8 @@ namespace Sass {
}
else {
sources.insert(complex, withExtender);
/*
// Seems only relevant for sass 4.0 modules
for (auto& component : complex->elements()) {
if (auto compound = component->getCompound()) {
for (auto& simple : compound->elements()) {
Expand All @@ -465,15 +471,19 @@ namespace Sass {
if (newExtensions.find(extension.target) != newExtensions.end()) {
additionalExtensions[extension.target].insert(complex, withExtender);
}
*/
}
}

// If [selectors] doesn't contain [extension.extender],
// for example if it was replaced due to :not() expansion,
// we must get rid of the old version.
/*
// Seems only relevant for sass 4.0 modules
if (!containsExtension) {
sources.erase(extension.extender);
}
*/

}

Expand Down
7 changes: 0 additions & 7 deletions src/extender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,6 @@ namespace Sass {
const Extension& lhs,
const Extension& rhs);

// ##########################################################################
// Helper function to copy extension between maps
// ##########################################################################
static void mapCopyExts(
ExtSelExtMap& dest,
const ExtSelExtMap& source);

// ##########################################################################
// Extend [extensions] using [newExtensions].
// ##########################################################################
Expand Down

0 comments on commit 3d61646

Please sign in to comment.