mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-07 09:22:11 +00:00
Fix performance regression in loading compile_commands.json
Regression was caused by accidental copying.
This commit is contained in:
parent
738b338d47
commit
ccff74a79c
@ -30,9 +30,10 @@ namespace {
|
|||||||
bool g_disable_normalize_path_for_test = false;
|
bool g_disable_normalize_path_for_test = false;
|
||||||
|
|
||||||
std::string NormalizePathWithTestOptOut(const std::string& path) {
|
std::string NormalizePathWithTestOptOut(const std::string& path) {
|
||||||
if (g_disable_normalize_path_for_test)
|
if (g_disable_normalize_path_for_test) {
|
||||||
return "&" +
|
// Add a & so we can test to verify a path is normalized.
|
||||||
path; // Add a & so we can test to verify a path is normalized.
|
return "&" + path;
|
||||||
|
}
|
||||||
return NormalizePath(path);
|
return NormalizePath(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +123,7 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto cleanup_maybe_relative_path = [entry](const std::string& path) {
|
auto cleanup_maybe_relative_path = [&](const std::string& path) {
|
||||||
assert(!path.empty());
|
assert(!path.empty());
|
||||||
if (path[0] == '/')
|
if (path[0] == '/')
|
||||||
return NormalizePathWithTestOptOut(path);
|
return NormalizePathWithTestOptOut(path);
|
||||||
|
Loading…
Reference in New Issue
Block a user