Skip to content

Commit 57196d6

Browse files
committed
Expand: pass std::string_view() to find()
1 parent 82aa1ce commit 57196d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Expand.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
#include "Expand.hxx"
66

7+
using std::string_view_literals::operator""sv;
8+
79
void
810
Expand(std::string &p, const StringMap &vars) noexcept
911
{
1012
const std::string src = std::move(p);
1113
p.clear();
1214

1315
std::string::size_type start = 0, pos;
14-
while ((pos = src.find("${", start)) != src.npos) {
16+
while ((pos = src.find("${"sv, start)) != src.npos) {
1517
std::string::size_type end = src.find('}', start + 2);
1618
if (end == src.npos)
1719
break;

0 commit comments

Comments
 (0)