MCPcopy Create free account
hub / github.com/catboost/catboost / IsIntersect

Function IsIntersect

util/string/subst.cpp:31–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30template <typename T, typename U>
31static bool IsIntersect(const T& a, const U& b) noexcept {
32 if (b.data() < a.data()) {
33 return IsIntersect(b, a);
34 }
35
36 return !a.empty() && !b.empty() &&
37 ((a.data() <= b.data() && b.data() < a.data() + a.size()) ||
38 (a.data() < b.data() + b.size() && b.data() + b.size() <= a.data() + a.size()));
39}
40
41/**
42 * Replaces all occurences of substring @c from in string @c s to string @c to.

Callers 1

SubstGlobalImplFunction · 0.70

Calls 3

dataMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected