Skip to content

Commit 2494f0e

Browse files
glebmxzyfer
authored andcommitted
Minor fix: Reserve lists with correct sizes
1 parent 84eaca2 commit 2494f0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ namespace Sass {
12401240
Selector_List_Ptr parents = pstack.back();
12411241

12421242
if (!this->has_real_parent_ref() && !implicit_parent) {
1243-
Selector_List_Ptr retval = SASS_MEMORY_NEW(Selector_List, pstate());
1243+
Selector_List_Ptr retval = SASS_MEMORY_NEW(Selector_List, pstate(), 1);
12441244
retval->append(this);
12451245
return retval;
12461246
}

src/fn_lists.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace Sass {
8484
if (index < 0 || index > len - 1) error("index out of bounds for `" + std::string(sig) + "`", pstate, traces);
8585

8686
if (m) {
87-
l = SASS_MEMORY_NEW(List, pstate, 1);
87+
l = SASS_MEMORY_NEW(List, pstate, 2);
8888
l->append(m->keys()[static_cast<unsigned int>(index)]);
8989
l->append(m->at(m->keys()[static_cast<unsigned int>(index)]));
9090
return l.detach();
@@ -281,4 +281,4 @@ namespace Sass {
281281

282282
}
283283

284-
}
284+
}

0 commit comments

Comments
 (0)