[PATCH] D51528: [NFC] Cleanup Dex

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 31 01:37:19 PDT 2018

ioeric accepted this revision.
ioeric added inline comments.
This revision is now accepted and ready to land.

Comment at: clang-tools-extra/clangd/index/dex/DexIndex.cpp:33
   std::vector<Token> Result = generateIdentifierTrigrams(Sym.Name);
-  Result.push_back(Token(Token::Kind::Scope, Sym.Scope));
+  Result.emplace_back(Token(Token::Kind::Scope, Sym.Scope));
   return Result;
Do you still need to spell out the constructor with `emplace_back`?

Comment at: clang-tools-extra/clangd/index/dex/Iterator.cpp:395
   for (; !It.reachedEnd(); It.advance())
-    Result.push_back(std::make_pair(It.peek(), It.consume()));
+    Result.emplace_back(std::make_pair(It.peek(), It.consume()));
   return Result;
No need for `make_pair` here?


More information about the cfe-commits mailing list