MCPcopy Create free account
hub / github.com/apache/arrow / UTF8FindIf

Function UTF8FindIf

cpp/src/arrow/util/utf8_internal.h:448–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446
447template <class Predicate>
448static inline bool UTF8FindIf(const uint8_t* first, const uint8_t* last,
449 Predicate&& predicate, const uint8_t** position) {
450 const uint8_t* i = first;
451 while (i < last) {
452 uint32_t codepoint = 0;
453 const uint8_t* current = i;
454 if (ARROW_PREDICT_FALSE(!UTF8Decode(&i, &codepoint))) {
455 return false;
456 }
457 if (predicate(codepoint)) {
458 *position = current;
459 return true;
460 }
461 }
462 *position = last;
463 return true;
464}
465
466// Same semantics as std::find_if using reverse iterators with the return value
467// having the same semantics as std::reverse_iterator<..>.base()

Callers 4

TESTFunction · 0.85
UTF8AdvanceCodepointsFunction · 0.85
TransformMethod · 0.85
TransformMethod · 0.85

Calls 1

UTF8DecodeFunction · 0.85

Tested by 1

TESTFunction · 0.68