From 5c1a9f3bc0f11905974450ee7729ae3d556d316f Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Tue, 18 Jun 2013 04:41:50 +0000 Subject: [PATCH] Simplify a loop in ProcessCodeCompleteResults(). Pointed out by David Blaikie git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184169 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/CIndexCodeCompletion.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp index 411728b789..58dc021870 100644 --- a/tools/libclang/CIndexCodeCompletion.cpp +++ b/tools/libclang/CIndexCodeCompletion.cpp @@ -562,12 +562,12 @@ namespace { AllocatedResults.Contexts = getContextsForContextKind(contextKind, S); AllocatedResults.Selector = ""; - for (unsigned i = 0, e = Context.getSelIdents().size(); i != e; i++) { - IdentifierInfo *selIdent = Context.getSelIdents()[i]; - if (selIdent != NULL) { - StringRef selectorString = Context.getSelIdents()[i]->getName(); - AllocatedResults.Selector += selectorString; - } + ArrayRef SelIdents = Context.getSelIdents(); + for (ArrayRef::iterator I = SelIdents.begin(), + E = SelIdents.end(); + I != E; ++I) { + if (IdentifierInfo *selIdent = *I) + AllocatedResults.Selector += selIdent->getName(); AllocatedResults.Selector += ":"; } -- 2.40.0