From af2d82dfc17ccd0c32b0955b1588e3bca379ccab Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 18 Apr 2014 13:45:33 +0100 Subject: Add StringView class for non owning string --- src/string.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/string.cc') diff --git a/src/string.cc b/src/string.cc index 23457413..46d492f1 100644 --- a/src/string.cc +++ b/src/string.cc @@ -83,7 +83,7 @@ void option_from_string(const String& str, Regex& re) } } -bool prefix_match(const String& str, const String& prefix) +bool prefix_match(StringView str, StringView prefix) { auto it = str.begin(); for (auto& c : prefix) @@ -94,7 +94,7 @@ bool prefix_match(const String& str, const String& prefix) return true; } -bool subsequence_match(const String& str, const String& subseq) +bool subsequence_match(StringView str, StringView subseq) { auto it = str.begin(); for (auto& c : subseq) -- cgit v1.2.3