MCPcopy Create free account
hub / github.com/acl-dev/acl / test_stdmap

Function test_stdmap

lib_acl_cpp/samples/benchmark/token_tree/main.cpp:94–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94static void test_stdmap(int max)
95{
96 std::map<std::string, bool> map;
97
98 for (int i = 0; tokens[i] != NULL; i++) {
99 map[tokens[i]] = true;
100 }
101
102 acl::meter_time(__FUNCTION__, __LINE__, "begin\t");
103
104 int j = 0;
105 for (int i = 0; i < max; i++) {
106 if (map.find(tokens[j]) == map.end()) {
107 printf("find error, key=%s\r\n", tokens[j]);
108 break;
109 }
110 if (tokens[++j] == NULL) {
111 j = 0;
112 }
113 }
114
115 acl::meter_time(__FUNCTION__, __LINE__, "end\t");
116}
117
118static void usage(const char* procname)
119{

Callers 1

mainFunction · 0.85

Calls 3

meter_timeFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…