forked from OSchip/llvm-project
[Support] TrigramIndex::insert - pass std::String argument by const reference. NFCI.
Avoid string copies and fix clang-tidy warning.
This commit is contained in:
parent
d4ce062340
commit
344afa853f
|
@ -38,7 +38,7 @@ class StringRef;
|
|||
class TrigramIndex {
|
||||
public:
|
||||
/// Inserts a new Regex into the index.
|
||||
void insert(std::string Regex);
|
||||
void insert(const std::string &Regex);
|
||||
|
||||
/// Returns true, if special case list definitely does not have a line
|
||||
/// that matches the query. Returns false, if it's not sure.
|
||||
|
|
|
@ -25,7 +25,7 @@ static bool isAdvancedMetachar(unsigned Char) {
|
|||
return strchr(RegexAdvancedMetachars, Char) != nullptr;
|
||||
}
|
||||
|
||||
void TrigramIndex::insert(std::string Regex) {
|
||||
void TrigramIndex::insert(const std::string &Regex) {
|
||||
if (Defeated) return;
|
||||
std::set<unsigned> Was;
|
||||
unsigned Cnt = 0;
|
||||
|
|
Loading…
Reference in New Issue