[llvm] r241685 - Use a range loop. NFC.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jul 8 09:16:15 PDT 2015
Author: rafael
Date: Wed Jul 8 11:16:15 2015
New Revision: 241685
URL: http://llvm.org/viewvc/llvm-project?rev=241685&view=rev
Log:
Use a range loop. NFC.
Modified:
llvm/trunk/lib/Object/ArchiveWriter.cpp
Modified: llvm/trunk/lib/Object/ArchiveWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ArchiveWriter.cpp?rev=241685&r1=241684&r2=241685&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ArchiveWriter.cpp (original)
+++ llvm/trunk/lib/Object/ArchiveWriter.cpp Wed Jul 8 11:16:15 2015
@@ -281,16 +281,14 @@ llvm::writeArchive(StringRef ArcName,
unsigned LongNameMemberNum = 0;
unsigned NewMemberNum = 0;
std::vector<unsigned> MemberOffset;
- for (std::vector<NewArchiveIterator>::iterator I = NewMembers.begin(),
- E = NewMembers.end();
- I != E; ++I, ++MemberNum) {
+ for (const NewArchiveIterator &I : NewMembers) {
+ MemoryBufferRef File = Members[MemberNum++];
unsigned Pos = Out.tell();
MemberOffset.push_back(Pos);
- MemoryBufferRef File = Members[MemberNum];
- if (I->isNewMember()) {
- StringRef FileName = I->getNew();
+ if (I.isNewMember()) {
+ StringRef FileName = I.getNew();
const sys::fs::file_status &Status = NewMemberStatus[NewMemberNum];
NewMemberNum++;
@@ -305,8 +303,8 @@ llvm::writeArchive(StringRef ArcName,
Status.getGroup(), Status.permissions(),
Status.getSize());
} else {
- object::Archive::child_iterator OldMember = I->getOld();
- StringRef Name = I->getName();
+ object::Archive::child_iterator OldMember = I.getOld();
+ StringRef Name = I.getName();
if (Name.size() < 16)
printMemberHeader(Out, Name, OldMember->getLastModified(),
More information about the llvm-commits
mailing list