MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / intersect_with

Method intersect_with

src/QLPredicate.actor.cpp:401–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401Reference<RangePredicate> RangePredicate::intersect_with(Reference<RangePredicate> const& other) {
402 DataValue new_min_value;
403 bool new_min_closed;
404 DataValue new_max_value;
405 bool new_max_closed;
406
407 int cmp = min_value.compare(other->min_value);
408 if (cmp < 0) {
409 new_min_value = other->min_value;
410 new_min_closed = other->min_closed;
411 } else if (cmp > 0) {
412 new_min_value = min_value;
413 new_min_closed = min_closed;
414 } else {
415 new_min_value = min_value;
416 new_min_closed = (min_closed && other->min_closed);
417 }
418
419 cmp = max_value.compare(other->max_value);
420 if (cmp < 0) {
421 new_max_value = max_value;
422 new_max_closed = max_closed;
423 } else if (cmp > 0) {
424 new_max_value = other->max_value;
425 new_max_closed = other->max_closed;
426 } else {
427 new_max_value = max_value;
428 new_max_closed = (max_closed && other->max_closed);
429 }
430
431 return ref(new RangePredicate(new_min_value, new_min_closed, new_max_value, new_max_closed));
432}
433
434RegExPredicate::RegExPredicate(const std::string& _pattern, const std::string& _options) {
435 re.reset(new pcrecpp::RE(_pattern));

Callers 1

simplify_andMethod · 0.80

Calls 2

refFunction · 0.85
compareMethod · 0.45

Tested by

no test coverage detected