mirror of
https://github.com/MaskRay/ccls.git
synced 2025-08-17 20:22:23 +00:00
Remove needless lambda capture, consts, uniform init
This commit is contained in:
parent
85b31f7c1e
commit
2ad03284af
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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()) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user