[clangd] Simplify relations deserialization loop, NFC.

This commit is contained in:
Kadir Cetinkaya 2020-11-12 10:33:30 +01:00
parent 3225fcf11e
commit 6484aa1add
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
1 changed files with 2 additions and 4 deletions

View File

@ -508,10 +508,8 @@ llvm::Expected<IndexFileIn> readRIFF(llvm::StringRef Data) {
if (Chunks.count("rela")) {
Reader RelationsReader(Chunks.lookup("rela"));
RelationSlab::Builder Relations;
while (!RelationsReader.eof()) {
auto Relation = readRelation(RelationsReader);
Relations.insert(Relation);
}
while (!RelationsReader.eof())
Relations.insert(readRelation(RelationsReader));
if (RelationsReader.err())
return error("malformed or truncated relations");
Result.Relations = std::move(Relations).build();