MCPcopy Create free account
hub / github.com/ceph/ceph / subset_of

Method subset_of

src/include/interval_set.h:886–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884 }
885
886 bool subset_of(const interval_set &big) const {
887 if (!size())
888 return true;
889 if (size() > big.size())
890 return false;
891 if (range_end() > big.range_end())
892 return false;
893
894 /*
895 * Use the lower_bound algorithm for larger size ratios
896 * where it performs better, but not for smaller size
897 * ratios where sequential search performs better.
898 */
899 if (big.size() / size() < 10)
900 return subset_size_sym(big);
901
902 for (const auto& [start, len] : m) {
903 if (!big.contains(start, len)) return false;
904 }
905 return true;
906 }
907
908 /*
909 * build a subset of @other, starting at or after @start, and including

Callers 5

TYPED_TESTFunction · 0.45
TESTFunction · 0.45
TYPED_TESTFunction · 0.45
submit_push_dataMethod · 0.45
trim_pushed_dataMethod · 0.45

Calls 3

sizeMethod · 0.45
range_endMethod · 0.45
containsMethod · 0.45

Tested by 3

TYPED_TESTFunction · 0.36
TESTFunction · 0.36
TYPED_TESTFunction · 0.36