| 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 | |
| 521 | private: |
| 522 | Firebird::StartsEvaluator<CharType> evaluator; |
nothing calls this directly
no test coverage detected