Skip to content

Commit 3babd82

Browse files
committed
Improve null terminated lists handling
1 parent 43e0419 commit 3babd82

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/context.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ namespace Sass {
101101

102102
// load plugins and register custom behaviors
103103
for(auto plug : plugin_paths) { plugins.load_plugins(plug); }
104-
for(auto fn : plugins.get_headers()) { c_headers.push_back(fn); }
105-
for(auto fn : plugins.get_importers()) { c_importers.push_back(fn); }
106-
for(auto fn : plugins.get_functions()) { c_functions.push_back(fn); }
104+
const std::vector<Sass_Importer_Entry> headers = plugins.get_headers();
105+
const std::vector<Sass_Importer_Entry> importers = plugins.get_importers();
106+
const std::vector<Sass_Function_Entry> functions = plugins.get_functions();
107+
for(Sass_Importer_Entry fn : headers) { c_headers.push_back(fn); }
108+
for(Sass_Importer_Entry fn : importers) { c_importers.push_back(fn); }
109+
for(Sass_Function_Entry fn : functions) { c_functions.push_back(fn); }
107110

108111
// sort the items by priority (lowest first)
109112
sort (c_headers.begin(), c_headers.end(), sort_importers);

0 commit comments

Comments
 (0)