Skip to content

Commit

Permalink
Minor fix: Reserve lists with correct sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm authored and xzyfer committed Nov 23, 2018
1 parent 84eaca2 commit 2494f0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ namespace Sass {
Selector_List_Ptr parents = pstack.back();

if (!this->has_real_parent_ref() && !implicit_parent) {
Selector_List_Ptr retval = SASS_MEMORY_NEW(Selector_List, pstate());
Selector_List_Ptr retval = SASS_MEMORY_NEW(Selector_List, pstate(), 1);
retval->append(this);
return retval;
}
Expand Down
4 changes: 2 additions & 2 deletions src/fn_lists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace Sass {
if (index < 0 || index > len - 1) error("index out of bounds for `" + std::string(sig) + "`", pstate, traces);

if (m) {
l = SASS_MEMORY_NEW(List, pstate, 1);
l = SASS_MEMORY_NEW(List, pstate, 2);
l->append(m->keys()[static_cast<unsigned int>(index)]);
l->append(m->at(m->keys()[static_cast<unsigned int>(index)]));
return l.detach();
Expand Down Expand Up @@ -281,4 +281,4 @@ namespace Sass {

}

}
}

0 comments on commit 2494f0e

Please sign in to comment.