From c61e83e6de778e5bd937e401564fe6bd0836b727 Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Tue, 19 Feb 2013 09:48:30 +0000 Subject: Simplify code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175501 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitstreamReader.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'lib/Bitcode') diff --git a/lib/Bitcode/Reader/BitstreamReader.cpp b/lib/Bitcode/Reader/BitstreamReader.cpp index b133502..942346b 100644 --- a/lib/Bitcode/Reader/BitstreamReader.cpp +++ b/lib/Bitcode/Reader/BitstreamReader.cpp @@ -26,34 +26,28 @@ void BitstreamCursor::operator=(const BitstreamCursor &RHS) { // Copy abbreviations, and bump ref counts. CurAbbrevs = RHS.CurAbbrevs; - for (unsigned i = 0, e = static_cast(CurAbbrevs.size()); - i != e; ++i) + for (size_t i = 0, e = CurAbbrevs.size(); i != e; ++i) CurAbbrevs[i]->addRef(); // Copy block scope and bump ref counts. BlockScope = RHS.BlockScope; - for (unsigned S = 0, e = static_cast(BlockScope.size()); - S != e; ++S) { + for (size_t S = 0, e = BlockScope.size(); S != e; ++S) { std::vector &Abbrevs = BlockScope[S].PrevAbbrevs; - for (unsigned i = 0, e = static_cast(Abbrevs.size()); - i != e; ++i) + for (size_t i = 0, e = Abbrevs.size(); i != e; ++i) Abbrevs[i]->addRef(); } } void BitstreamCursor::freeState() { // Free all the Abbrevs. - for (unsigned i = 0, e = static_cast(CurAbbrevs.size()); - i != e; ++i) + for (size_t i = 0, e = CurAbbrevs.size(); i != e; ++i) CurAbbrevs[i]->dropRef(); CurAbbrevs.clear(); // Free all the Abbrevs in the block scope. - for (unsigned S = 0, e = static_cast(BlockScope.size()); - S != e; ++S) { + for (size_t S = 0, e = BlockScope.size(); S != e; ++S) { std::vector &Abbrevs = BlockScope[S].PrevAbbrevs; - for (unsigned i = 0, e = static_cast(Abbrevs.size()); - i != e; ++i) + for (size_t i = 0, e = Abbrevs.size(); i != e; ++i) Abbrevs[i]->dropRef(); } BlockScope.clear(); @@ -69,8 +63,7 @@ bool BitstreamCursor::EnterSubBlock(unsigned BlockID, unsigned *NumWordsP) { // Add the abbrevs specific to this block to the CurAbbrevs list. if (const BitstreamReader::BlockInfo *Info = BitStream->getBlockInfo(BlockID)) { - for (unsigned i = 0, e = static_cast(Info->Abbrevs.size()); - i != e; ++i) { + for (size_t i = 0, e = Info->Abbrevs.size(); i != e; ++i) { CurAbbrevs.push_back(Info->Abbrevs[i]); CurAbbrevs.back()->addRef(); } -- cgit v1.1