From 4c1f801b8198fc634abf558598b9038cd9fe9882 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 21 Oct 2014 21:07:49 +0000 Subject: [PATCH] Use a StringRef. No functionality change. llvm-svn: 220327 --- llvm/tools/llvm-ar/llvm-ar.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 56b5164..087b004 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -652,11 +652,10 @@ computeNewArchiveMembers(ArchiveOperation Operation, Ret.insert(Ret.begin() + InsertPos, Members.size(), NewArchiveIterator()); int Pos = InsertPos; - for (std::vector::iterator I = Members.begin(), - E = Members.end(); - I != E; ++I, ++Pos) { - StringRef Name = sys::path::filename(*I); - addMember(Ret, &*I, Name, Pos); + for (auto &Member : Members) { + StringRef Name = sys::path::filename(Member); + addMember(Ret, &Member, Name, Pos); + ++Pos; } return Ret; -- 2.7.4