Commit 79ec3b3c authored by Marco Bubke's avatar Marco Bubke

Clang: Fix CodeCompletionsExtractor

Setting a unsigned int to -1 is really stupid.

Change-Id: I43cd1ca1d92eed4a57575f21858a6ce50bcc4fe0
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent e016918e
......@@ -42,8 +42,6 @@ bool CodeCompletionsExtractor::next()
{
const uint cxCodeCompleteResultCount = cxCodeCompleteResults->NumResults;
++cxCodeCompleteResultIndex;
if (cxCodeCompleteResultIndex < cxCodeCompleteResultCount) {
currentCxCodeCompleteResult = cxCodeCompleteResults->Results[cxCodeCompleteResultIndex];
......@@ -58,6 +56,8 @@ bool CodeCompletionsExtractor::next()
extractCompletionChunks();
adaptPriority();
++cxCodeCompleteResultIndex;
return true;
}
......@@ -68,7 +68,7 @@ bool CodeCompletionsExtractor::peek(const Utf8String &name)
{
const uint cxCodeCompleteResultCount = cxCodeCompleteResults->NumResults;
uint peekCxCodeCompleteResultIndex = cxCodeCompleteResultIndex + 1;
uint peekCxCodeCompleteResultIndex = cxCodeCompleteResultIndex;
while (peekCxCodeCompleteResultIndex < cxCodeCompleteResultCount) {
if (hasText(name, cxCodeCompleteResults->Results[peekCxCodeCompleteResultIndex].CompletionString))
......
......@@ -77,7 +77,7 @@ private:
CodeCompletion currentCodeCompletion_;
CXCompletionResult currentCxCodeCompleteResult;
CXCodeCompleteResults *cxCodeCompleteResults;
uint cxCodeCompleteResultIndex = -1;
uint cxCodeCompleteResultIndex = 0;
};
std::ostream &operator<<(std::ostream &os, const CodeCompletionsExtractor &extractor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment