diff options
author | Yi Kong <yikong@google.com> | 2022-08-22 14:05:32 +0800 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2022-08-31 16:27:45 +0800 |
commit | 87b8bcbc707549f4a5193fa6dde7ba6a0245a1d3 (patch) | |
tree | bd7311b3feae926b2d0895a56fea8dab87ef2c2f | |
parent | 09dfa26c4e59b15919aaad6986f9b47c883dc4f1 (diff) | |
download | kati-87b8bcbc707549f4a5193fa6dde7ba6a0245a1d3.tar.gz |
Fix unqualified-std-cast-call compiler warning
Context: https://reviews.llvm.org/D119670
... also fixed a clang-format error.
-rw-r--r-- | src/func.cc | 5 | ||||
-rw-r--r-- | src/strutil.cc | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/func.cc b/src/func.cc index bd8d78d..89f9e16 100644 --- a/src/func.cc +++ b/src/func.cc @@ -614,9 +614,8 @@ void CallFunc(const vector<Value*>& args, Evaluator* ev, string* s) { } vector<unique_ptr<SimpleVar>> av; for (size_t i = 1; i < args.size(); i++) { - unique_ptr<SimpleVar> s( - new SimpleVar(args[i]->Eval(ev), VarOrigin::AUTOMATIC, nullptr, Loc())); - av.push_back(move(s)); + av.emplace_back(std::make_unique<SimpleVar>( + args[i]->Eval(ev), VarOrigin::AUTOMATIC, nullptr, Loc())); } vector<unique_ptr<ScopedGlobalVar>> sv; for (size_t i = 1;; i++) { diff --git a/src/strutil.cc b/src/strutil.cc index 8c4bdc0..4546265 100644 --- a/src/strutil.cc +++ b/src/strutil.cc @@ -160,8 +160,7 @@ bool Pattern::MatchImpl(StringPiece str) const { StringPiece Pattern::Stem(StringPiece str) const { if (!Match(str)) return ""; - return str.substr(percent_index_, - str.size() - pat_.size() + 1); + return str.substr(percent_index_, str.size() - pat_.size() + 1); } void Pattern::AppendSubst(StringPiece str, |