simpler implementation of startsWith

This commit is contained in:
Luis Díaz Más 2022-02-14 19:38:45 +01:00 committed by Luis Diaz
parent a725d22ea5
commit d1524e3d96

View File

@ -121,7 +121,7 @@ namespace Util {
bool startsWith(const std::string& s, const std::string& start)
{
return s.size() >= start.size() && std::memcmp(s.data(), start.data(), start.size()) == 0;
return s.find(start) == 0;
}