Remove needless lambda capture, consts, uniform init

This commit is contained in:
Daniel Chabrowski 2019-10-10 11:07:03 +02:00
parent 85b31f7c1e
commit 2ad03284af
5 changed files with 9 additions and 9 deletions

View File

@ -121,8 +121,8 @@ void ReplyOnce::replyLocationLink(std::vector<LocationLink> &result) {
if (g_config->client.linkSupport) { if (g_config->client.linkSupport) {
(*this)(result); (*this)(result);
} else { } else {
std::vector<Location> result1{std::make_move_iterator(result.begin()), std::vector<Location> result1(std::make_move_iterator(result.begin()),
std::make_move_iterator(result.end())}; std::make_move_iterator(result.end()));
(*this)(result1); (*this)(result1);
} }
} }

View File

@ -616,7 +616,7 @@ void mainLoop() {
SemaManager manager( SemaManager manager(
&project, &wfiles, &project, &wfiles,
[&](const std::string &path, std::vector<Diagnostic> diagnostics) { [](const std::string &path, std::vector<Diagnostic> diagnostics) {
PublishDiagnosticParam params; PublishDiagnosticParam params;
params.uri = DocumentUri::fromPath(path); params.uri = DocumentUri::fromPath(path);
params.diagnostics = std::move(diagnostics); params.diagnostics = std::move(diagnostics);
@ -718,7 +718,7 @@ void standalone(const std::string &root) {
VFS vfs; VFS vfs;
SemaManager manager( SemaManager manager(
nullptr, nullptr, nullptr, nullptr,
[&](const std::string &, const std::vector<Diagnostic> &) {}, [](const std::string &, const std::vector<Diagnostic> &) {},
[](const RequestId &id) {}); [](const RequestId &id) {});
IncludeComplete complete(&project); IncludeComplete complete(&project);

View File

@ -231,7 +231,7 @@ class StoreDiags : public DiagnosticConsumer {
} }
public: public:
StoreDiags(std::string path) : path{std::move(path)} {} StoreDiags(std::string path) : path(std::move(path)) {}
std::vector<Diag> take() { return std::move(output); } std::vector<Diag> take() { return std::move(output); }
bool isConcerned(const SourceManager &sm, SourceLocation l) { bool isConcerned(const SourceManager &sm, SourceLocation l) {
FileID fid = sm.getFileID(l); FileID fid = sm.getFileID(l);

View File

@ -35,7 +35,7 @@ bool gTestOutputMode = false;
namespace ccls { namespace ccls {
void JsonReader::iterArray(const llvm::function_ref<void()> fn) { void JsonReader::iterArray(llvm::function_ref<void()> fn) {
if (!m->IsArray()) if (!m->IsArray())
throw std::invalid_argument("array"); throw std::invalid_argument("array");
// Use "0" to indicate any element for now. // Use "0" to indicate any element for now.
@ -48,7 +48,7 @@ void JsonReader::iterArray(const llvm::function_ref<void()> fn) {
} }
path_.pop_back(); path_.pop_back();
} }
void JsonReader::member(const char *name, const llvm::function_ref<void()> fn) { void JsonReader::member(const char *name, llvm::function_ref<void()> fn) {
path_.push_back(name); path_.push_back(name);
auto it = m->FindMember(name); auto it = m->FindMember(name);
if (it != m->MemberEnd()) { if (it != m->MemberEnd()) {

View File

@ -49,8 +49,8 @@ struct JsonReader {
JsonReader(rapidjson::Value *m) : m(m) {} JsonReader(rapidjson::Value *m) : m(m) {}
void startObject() {} void startObject() {}
void endObject() {} void endObject() {}
void iterArray(const llvm::function_ref<void()> fn); void iterArray(llvm::function_ref<void()> fn);
void member(const char *name, const llvm::function_ref<void()> fn); void member(const char *name, llvm::function_ref<void()> fn);
bool isNull(); bool isNull();
std::string getString(); std::string getString();
std::string getPath() const; std::string getPath() const;