Skip to content

Commit ba46166

Browse files
authored
Merge pull request #8148 from diffblue/dstringt-starts_with
dstringt::starts_with can be const
2 parents 6494e9e + fc7cc8f commit ba46166

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/dstring.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class dstringt final
9393
}
9494

9595
/// equivalent of as_string().starts_with(s)
96-
bool starts_with(const char *s)
96+
bool starts_with(const char *s) const
9797
{
9898
for(const char *t = c_str(); *s != 0; s++, t++)
9999
if(*t != *s)
@@ -103,7 +103,7 @@ class dstringt final
103103
}
104104

105105
/// equivalent of as_string().starts_with(s)
106-
bool starts_with(const std::string &prefix)
106+
bool starts_with(const std::string &prefix) const
107107
{
108108
return as_string().compare(0, prefix.size(), prefix) == 0;
109109
}

0 commit comments

Comments
 (0)