Use StringViews for some helper functions in selectors.cc
This commit is contained in:
parent
4051534b83
commit
b167c11671
|
@ -392,7 +392,7 @@ Selection select_whitespaces(const Buffer& buffer, const Selection& selection, O
|
||||||
: utf8_range(last, first);
|
: utf8_range(last, first);
|
||||||
}
|
}
|
||||||
|
|
||||||
static CharCount get_indent(const String& str, int tabstop)
|
static CharCount get_indent(StringView str, int tabstop)
|
||||||
{
|
{
|
||||||
CharCount indent = 0;
|
CharCount indent = 0;
|
||||||
for (auto& c : str)
|
for (auto& c : str)
|
||||||
|
@ -407,7 +407,7 @@ static CharCount get_indent(const String& str, int tabstop)
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_only_whitespaces(const String& str)
|
static bool is_only_whitespaces(StringView str)
|
||||||
{
|
{
|
||||||
auto it = str.begin();
|
auto it = str.begin();
|
||||||
skip_while(it, str.end(),
|
skip_while(it, str.end(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user