Address PR comments.

This commit is contained in:
Mirza Halilcevic
2024-10-09 08:39:43 +00:00
parent d3a96e5111
commit 3b2a7aeef7
5 changed files with 91 additions and 91 deletions

View File

@@ -100,33 +100,5 @@ inline auto Transform(const Range1& r1, const Range2& r2, F f)
return result;
}
inline bool StartsWith(const std::string& value, const std::string& prefix)
{
if(prefix.size() > value.size())
return false;
else
return std::equal(prefix.begin(), prefix.end(), value.begin());
}
inline bool EndsWith(const std::string& value, const std::string& suffix)
{
if(suffix.size() > value.size())
return false;
else
return std::equal(suffix.rbegin(), suffix.rend(), value.rbegin());
}
inline std::vector<std::string> SplitString(const std::string& s, char delim)
{
std::vector<std::string> elems;
std::stringstream ss(s + delim);
std::string item;
while(std::getline(ss, item, delim))
{
elems.push_back(item);
}
return elems;
}
} // namespace host
} // namespace ck