Skip to content

Commit 9fcfffc

Browse files
Robert Alm Nilssonvoidanix
authored andcommitted
Don't construct the string outside of vector
This code caused the string to be constructed and then moved into the vector. With this change the string in constructed inside the vector.
1 parent f739a83 commit 9fcfffc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/engine/command.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,7 @@ void explodelist(const char *s, std::vector<std::string> &elems, int limit)
27982798
{
27992799
const char *start, *end;
28002800
while((limit < 0 || elems.size() < limit) && parselist(s, start, end))
2801-
elems.emplace_back(std::string(start, end-start));
2801+
elems.emplace_back(start, end - start);
28022802
}
28032803

28042804
char *indexlist(const char *s, int pos)

0 commit comments

Comments
 (0)