mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd: Simplify some stringops.
This commit is contained in:
parent
ade6ad79d9
commit
048ecf07bb
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue