[clangd] Fix MSVC compile error, attempt 2

This commit is contained in:
Kadir Cetinkaya 2020-04-15 09:33:12 +02:00
parent 6d53897554
commit 2cd0be02b9
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
1 changed files with 7 additions and 1 deletions

View File

@ -190,7 +190,13 @@ FileShardedIndex::FileShardedIndex(IndexFileIn Input, PathRef HintPath)
}
}
std::vector<PathRef> FileShardedIndex::getAllFiles() const {
return std::vector<PathRef>(Shards.keys().begin(), Shards.keys().end());
// It should be enough to construct a vector with {Shards.keys().begin(),
// Shards.keys().end()} but MSVC fails to compile that.
std::vector<PathRef> Result;
Result.reserve(Shards.size());
for (PathRef Key : Shards.keys())
Result.push_back(Key);
return Result;
}
IndexFileIn FileShardedIndex::getShard(PathRef File) const {