MCPcopy Create free account
hub / github.com/apache/arrow / FlattenVectors

Function FlattenVectors

cpp/src/arrow/util/vector.h:131–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130template <typename T>
131std::vector<T> FlattenVectors(const std::vector<std::vector<T>>& vecs) {
132 std::size_t sum = 0;
133 for (const auto& vec : vecs) {
134 sum += vec.size();
135 }
136 std::vector<T> out;
137 out.reserve(sum);
138 for (const auto& vec : vecs) {
139 out.insert(out.end(), vec.begin(), vec.end());
140 }
141 return out;
142}
143
144template <typename T>
145Result<std::vector<T>> UnwrapOrRaise(std::vector<Result<T>>&& results) {

Callers 2

CollectFileInfoGeneratorFunction · 0.85
TESTFunction · 0.85

Calls 5

sizeMethod · 0.45
reserveMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by 2

CollectFileInfoGeneratorFunction · 0.68
TESTFunction · 0.68