summaryrefslogtreecommitdiff
path: root/tools/libclang/CIndexCodeCompletion.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-06-18 04:02:26 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-06-18 04:02:26 +0000
commit68effa0d764cf6fc7b6f9729481ee2c6c5143f3b (patch)
tree19073bfb0c5bf6b77c0353b51504e811c3ce0190 /tools/libclang/CIndexCodeCompletion.cpp
parent904df3e61a8043c60dc733933219a1e1466de5a6 (diff)
downloadclang-68effa0d764cf6fc7b6f9729481ee2c6c5143f3b.tar.gz
clang-68effa0d764cf6fc7b6f9729481ee2c6c5143f3b.tar.bz2
clang-68effa0d764cf6fc7b6f9729481ee2c6c5143f3b.tar.xz
ArrayRef'ize CodeCompletionContext::getNumSelIdents()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r--tools/libclang/CIndexCodeCompletion.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp
index bfd54f5c00..411728b789 100644
--- a/tools/libclang/CIndexCodeCompletion.cpp
+++ b/tools/libclang/CIndexCodeCompletion.cpp
@@ -562,15 +562,13 @@ namespace {
AllocatedResults.Contexts = getContextsForContextKind(contextKind, S);
AllocatedResults.Selector = "";
- if (Context.getNumSelIdents() > 0) {
- for (unsigned i = 0; i < Context.getNumSelIdents(); i++) {
- IdentifierInfo *selIdent = Context.getSelIdents()[i];
- if (selIdent != NULL) {
- StringRef selectorString = Context.getSelIdents()[i]->getName();
- AllocatedResults.Selector += selectorString;
- }
- 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;
}
+ AllocatedResults.Selector += ":";
}
QualType baseType = Context.getBaseType();