MCPcopy Create free account
hub / github.com/catboost/catboost / operator()

Method operator()

library/cpp/yt/string/string.cpp:291–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289////////////////////////////////////////////////////////////////////////////////
290
291size_t TCaseInsensitiveStringHasher::operator()(TStringBuf arg) const
292{
293 auto compute = [&] (char* buffer) {
294 for (size_t index = 0; index < arg.length(); ++index) {
295 buffer[index] = AsciiToLower(arg[index]);
296 }
297 return ComputeHash(TStringBuf(buffer, arg.length()));
298 };
299 const size_t SmallSize = 256;
300 if (arg.length() <= SmallSize) {
301 std::array<char, SmallSize> stackBuffer;
302 return compute(stackBuffer.data());
303 } else {
304 std::unique_ptr<char[]> heapBuffer(new char[arg.length()]);
305 return compute(heapBuffer.get());
306 }
307}
308
309bool TCaseInsensitiveStringEqualComparer::operator()(TStringBuf lhs, TStringBuf rhs) const
310{

Callers

nothing calls this directly

Calls 8

AsciiToLowerFunction · 0.85
ComputeHashFunction · 0.85
computeFunction · 0.85
AsciiEqualsIgnoreCaseFunction · 0.85
AsciiCompareIgnoreCaseFunction · 0.50
lengthMethod · 0.45
dataMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected