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) {
(*this)(result);
} else {
std::vector<Location> result1{std::make_move_iterator(result.begin()),
std::make_move_iterator(result.end())};
std::vector<Location> result1(std::make_move_iterator(result.begin()),
std::make_move_iterator(result.end()));
(*this)(result1);
}
}

View File

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

View File

@ -231,7 +231,7 @@ class StoreDiags : public DiagnosticConsumer {
}
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); }
bool isConcerned(const SourceManager &sm, SourceLocation l) {
FileID fid = sm.getFileID(l);

View File

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

View File

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