MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / evaluate

Method evaluate

src/jrd/Collation.cpp:495–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493 }
494
495 static bool evaluate(MemoryPool& pool, TextType* ttype, const UCHAR* s, SLONG sl,
496 const UCHAR* p, SLONG pl)
497 {
498 if (sl > pl)
499 {
500 auto charSet = ttype->getCharSet();
501
502 sl = charSet->isMultiByte() ?
503 MIN(sl, pl / charSet->minBytesPerChar() * charSet->maxBytesPerChar()) :
504 pl;
505 }
506
507 StrConverter cvt1(pool, ttype, p, pl);
508 fb_assert(pl % sizeof(CharType) == 0);
509
510 StrConverter cvt2(pool, ttype, s, sl);
511 fb_assert(sl % sizeof(CharType) == 0);
512
513 Firebird::StartsEvaluator<CharType> evaluator(pool,
514 reinterpret_cast<const CharType*>(p), pl / sizeof(CharType));
515
516 evaluator.processNextChunk(reinterpret_cast<const CharType*>(s), sl / sizeof(CharType));
517
518 return evaluator.getResult();
519 }
520
521private:
522 Firebird::StartsEvaluator<CharType> evaluator;

Callers

nothing calls this directly

Calls 6

isMultiByteMethod · 0.80
minBytesPerCharMethod · 0.80
getCharSetMethod · 0.45
maxBytesPerCharMethod · 0.45
processNextChunkMethod · 0.45
getResultMethod · 0.45

Tested by

no test coverage detected