Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
trivial micro-optimization: lazily call the virtual method instead of…
Browse files Browse the repository at this point in the history
… eagerly calling it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172953 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Jan 20, 2013
1 parent 4156ca7 commit 1ca114a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions include/llvm/Bitcode/BitstreamReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ struct BitstreamEntry {
BitstreamEntry E; E.Kind = Record; E.ID = AbbrevID; return E;
}
};


/// BitstreamCursor - This represents a position within a bitcode file. There
/// may be multiple independent cursors reading within one bitstream, each
Expand Down Expand Up @@ -251,7 +250,7 @@ class BitstreamCursor {
}

bool AtEndOfStream() {
return isEndPos(NextChar) && BitsInCurWord == 0;
return BitsInCurWord == 0 && isEndPos(NextChar);
}

/// getAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
Expand Down
2 changes: 1 addition & 1 deletion lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ bool BitcodeReader::ParseMetadata() {
default: // Default behavior: ignore.
break;
case bitc::METADATA_NAME: {
// Read named of the named metadata.
// Read name of the named metadata.
SmallString<8> Name(Record.begin(), Record.end());
Record.clear();
Code = Stream.ReadCode();
Expand Down

0 comments on commit 1ca114a

Please sign in to comment.