From 048ecf07bb4c4acabc5fad3f481ecae3b23925d4 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 6 Apr 2018 22:22:55 -0700 Subject: [PATCH] ircd: Simplify some stringops. --- include/ircd/stringops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ircd/stringops.h b/include/ircd/stringops.h index 4b98a04a3..20c024cef 100644 --- a/include/ircd/stringops.h +++ b/include/ircd/stringops.h @@ -264,7 +264,7 @@ inline bool ircd::startswith(const string_view &str, const char &val) { - return !str.empty() && str[0] == val; + return !str.empty() && str.front() == val; } /// Test if a string starts with a string @@ -302,7 +302,7 @@ inline bool ircd::endswith(const string_view &str, const char &val) { - return !str.empty() && str[str.size()-1] == val; + return !str.empty() && str.back() == val; } /// Test if a string ends with a string