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

Function DeleteVectorElement

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

Source from the content-addressed store, hash-verified

31
32template <typename T>
33std::vector<T> DeleteVectorElement(const std::vector<T>& values, size_t index) {
34 ARROW_DCHECK(!values.empty());
35 ARROW_DCHECK_LT(index, values.size());
36 std::vector<T> out;
37 out.reserve(values.size() - 1);
38 for (size_t i = 0; i < index; ++i) {
39 out.push_back(values[i]);
40 }
41 for (size_t i = index + 1; i < values.size(); ++i) {
42 out.push_back(values[i]);
43 }
44 return out;
45}
46
47template <typename T>
48std::vector<T> AddVectorElement(const std::vector<T>& values, size_t index,

Callers 4

RemoveColumnMethod · 0.85
RemoveFieldMethod · 0.85
RemoveColumnMethod · 0.85
TESTFunction · 0.85

Calls 4

push_backMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
reserveMethod · 0.45

Tested by 1

TESTFunction · 0.68