Skip to content
Permalink
Browse files

Minor fix: Reserve lists with correct sizes

  • Loading branch information...
glebm authored and xzyfer committed Nov 22, 2018
1 parent 84eaca2 commit 2494f0e2f26ac7ce7292b9bb988fc32bccdec500
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/ast.cpp
  2. +2 −2 src/fn_lists.cpp
@@ -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;
}
@@ -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();
@@ -281,4 +281,4 @@ namespace Sass {

}

}
}

0 comments on commit 2494f0e

Please sign in to comment.
You can’t perform that action at this time.