MCPcopy Create free account
hub / github.com/apache/impala / TryStripSuffixString

Function TryStripSuffixString

be/src/gutil/strings/strip.cc:45–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45bool TryStripSuffixString(StringPiece str, const StringPiece& suffix,
46 string* result) {
47 const bool has_suffix = str.ends_with(suffix);
48 if (has_suffix)
49 str.remove_suffix(suffix.length());
50 str.as_string().swap(*result);
51 return has_suffix;
52}
53
54// ----------------------------------------------------------------------
55// StripString

Callers 2

InitMethod · 0.85
GenerateMethod · 0.85

Calls 5

ends_withMethod · 0.80
remove_suffixMethod · 0.80
as_stringMethod · 0.80
lengthMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected