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

Function RemoveAll

util/string/util.h:193–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191// Removes all occurrences of given character from string
192template <typename TStringType>
193void RemoveAll(TStringType& str, typename TStringType::char_type ch) {
194 size_t pos = str.find(ch); // 'find' to avoid cloning of string in 'TString.begin()'
195 if (pos == TStringType::npos) {
196 return;
197 }
198
199 typename TStringType::iterator begin = str.begin();
200 typename TStringType::iterator end = begin + str.length();
201 typename TStringType::iterator it = std::remove(begin + pos, end, ch);
202 str.erase(it, end);
203}

Callers 4

PatchEntryMethod · 0.85
AddNameMethod · 0.85
TestRemoveAllMethod · 0.85

Calls 5

removeFunction · 0.50
findMethod · 0.45
beginMethod · 0.45
lengthMethod · 0.45
eraseMethod · 0.45

Tested by 1

TestRemoveAllMethod · 0.68