From d1524e3d96cbd99de2ce4e4c7cfa74a5252f168f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Mon, 14 Feb 2022 19:38:45 +0100 Subject: [PATCH] simpler implementation of startsWith --- src/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.cpp b/src/utils.cpp index 389e4710..097954c8 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -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; }