mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
Don't parse version for json if there is no expected version.
This commit is contained in:
parent
1d98797f26
commit
35c407b2ac
@ -359,13 +359,13 @@ std::unique_ptr<IndexFile> Deserialize(SerializeFormat format,
|
||||
switch (format) {
|
||||
case SerializeFormat::Json: {
|
||||
rapidjson::Document reader;
|
||||
if (gTestOutputMode)
|
||||
if (gTestOutputMode || !expected_version) {
|
||||
reader.Parse(serialized_index_content.c_str());
|
||||
else {
|
||||
} else {
|
||||
const char* p = strchr(serialized_index_content.c_str(), '\n');
|
||||
if (!p)
|
||||
return nullptr;
|
||||
if (expected_version && atoi(serialized_index_content.c_str()) != *expected_version)
|
||||
if (atoi(serialized_index_content.c_str()) != *expected_version)
|
||||
return nullptr;
|
||||
reader.Parse(p + 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user