-
#include "tensorstore/kvstore/key_range.h" -
static std::string_view
tensorstore::KeyRange::RemovePrefixFromExclusiveMax(
std::string_view prefix,
std::string_view exclusive_max); Returns the
exclusive_maxbound, relative toprefix, on the set of keyskfor whichprefix + k < exclusive_max.If
exclusive_maxdoes not start withprefix, returns an empty string (no upper bound). This is only meaningful ifprefix < exclusive_max(orexclusive_maxis empty), i.e. at least one key starting withprefixis less thanexclusive_max; the caller is responsible for handling the case where no such key exists.For example:
RemovePrefixFromExclusiveMax("a/", "a/d") == "d" RemovePrefixFromExclusiveMax("a/", "b") == "" RemovePrefixFromExclusiveMax("a/", "") == ""