MCPcopy Create free account
hub / github.com/Snapchat/Valdi / internStrings

Function internStrings

valdi/test/benchmark/utils/benchmark_utils.cpp:5–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <random>
4
5std::vector<StringBox> internStrings(StringCache& stringCache, const std::vector<std::string>& strings) {
6 std::vector<StringBox> cachedStrings;
7
8 for (const auto& str : strings) {
9 cachedStrings.emplace_back(stringCache.makeString(str));
10 }
11
12 return cachedStrings;
13}
14
15std::default_random_engine generator;
16std::uniform_int_distribution<int> distribution(' ', '~');

Callers 4

InternedStringComparisonFunction · 0.85

Calls 1

makeStringMethod · 0.80

Tested by

no test coverage detected