0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-28 14:58:20 +02:00

ircd: Simplify some stringops.

This commit is contained in:
Jason Volk 2018-04-06 22:22:55 -07:00
parent ade6ad79d9
commit 048ecf07bb

View file

@ -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