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

Function MakeIntStrings

cpp/src/arrow/util/value_parsing_benchmark.cc:42–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41template <typename c_int>
42static std::vector<std::string> MakeIntStrings(int32_t num_items) {
43 using c_int_limits = std::numeric_limits<c_int>;
44 std::vector<std::string> base_strings = {"0",
45 "5",
46 c_int_limits::is_signed ? "-12" : "12",
47 "34",
48 "99",
49 c_int_limits::is_signed ? "-111" : "111",
50 std::to_string(c_int_limits::min()),
51 std::to_string(c_int_limits::max())};
52 std::vector<std::string> strings;
53 for (int32_t i = 0; i < num_items; ++i) {
54 strings.push_back(base_strings[i % base_strings.size()]);
55 }
56 return strings;
57}
58
59template <typename c_int>
60static std::vector<std::string> MakeHexStrings(int32_t num_items) {

Callers

nothing calls this directly

Calls 3

to_stringFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected