Simplify type. NFC.

llvm-svn: 312675
This commit is contained in:
Rafael Espindola 2017-09-06 22:16:32 +00:00
parent e7a60708ff
commit 17e93d28f2
2 changed files with 4 additions and 4 deletions

View File

@ -200,12 +200,12 @@ void InputSectionBase::uncompress() {
Config->IsLE, Config->Is64));
size_t Size = Dec.getDecompressedSize();
UncompressBuf.reset(new std::vector<uint8_t>(Size));
if (Error E = Dec.decompress({(char *)UncompressBuf->data(), Size}))
UncompressBuf.reset(new char[Size]());
if (Error E = Dec.decompress({UncompressBuf.get(), Size}))
fatal(toString(this) +
": decompress failed: " + llvm::toString(std::move(E)));
this->Data = *UncompressBuf;
this->Data = makeArrayRef((uint8_t *)UncompressBuf.get(), Size);
this->Flags &= ~(uint64_t)SHF_COMPRESSED;
}

View File

@ -187,7 +187,7 @@ public:
private:
// A pointer that owns uncompressed data if a section is compressed by zlib.
// Since the feature is not used often, this is usually a nullptr.
std::unique_ptr<std::vector<uint8_t>> UncompressBuf;
std::unique_ptr<char[]> UncompressBuf;
};
// SectionPiece represents a piece of splittable section contents.