mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-21 07:59:27 +00:00
Fix clang 3.5 compile error
This commit is contained in:
parent
c98d53cfe2
commit
e0e3a39d5d
@ -286,10 +286,10 @@ std::vector<FileContents> PreloadFileContents(
|
||||
// index->file_contents comes from cache, so we need to check if that cache is
|
||||
// still valid. if so, we can use it, otherwise we need to load from disk.
|
||||
auto get_latest_content = [](const std::string& path, int64_t cached_time,
|
||||
const std::string& cached) {
|
||||
const std::string& cached) -> std::string {
|
||||
optional<int64_t> mod_time = GetLastModificationTime(path);
|
||||
if (!mod_time)
|
||||
return std::string("");
|
||||
return "";
|
||||
|
||||
if (*mod_time == cached_time)
|
||||
return cached;
|
||||
@ -297,7 +297,7 @@ std::vector<FileContents> PreloadFileContents(
|
||||
optional<std::string> fresh_content = ReadContent(path);
|
||||
if (!fresh_content) {
|
||||
LOG_S(ERROR) << "Failed to load content for " << path;
|
||||
return std::string("");
|
||||
return "";
|
||||
}
|
||||
return *fresh_content;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user