File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
src/common/winq/extension Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class ValueArray : public std::vector<T> {
46
46
template <typename U, typename Enable = typename std::enable_if<std::is_constructible<T, U>::value>::type>
47
47
ValueArray (const std::list<U>& others)
48
48
{
49
+ this ->reserve (others.size ());
49
50
for (const auto & other : others) {
50
51
this ->emplace_back (other);
51
52
}
@@ -54,6 +55,7 @@ class ValueArray : public std::vector<T> {
54
55
template <typename U, typename Enable = typename std::enable_if<std::is_constructible<T, U>::value>::type>
55
56
ValueArray (const std::initializer_list<U>& others)
56
57
{
58
+ this ->reserve (others.size ());
57
59
for (const auto & other : others) {
58
60
this ->emplace_back (other);
59
61
}
@@ -62,6 +64,7 @@ class ValueArray : public std::vector<T> {
62
64
template <typename U, typename Enable = typename std::enable_if<std::is_constructible<T, U>::value>::type>
63
65
ValueArray (const std::vector<U>& others)
64
66
{
67
+ this ->reserve (others.size ());
65
68
for (const auto & other : others) {
66
69
this ->emplace_back (other);
67
70
}
You can’t perform that action at this time.
0 commit comments