[gnome-builder] clang: avoid function call in sort callback
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: avoid function call in sort callback
- Date: Thu, 1 Oct 2015 23:56:53 +0000 (UTC)
commit 4762183577978d2c3cd6e1466bb6488c4663b6d9
Author: Christian Hergert <christian hergert me>
Date: Thu Oct 1 16:53:46 2015 -0700
clang: avoid function call in sort callback
plugins/clang/ide-clang-completion-provider.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/plugins/clang/ide-clang-completion-provider.c b/plugins/clang/ide-clang-completion-provider.c
index f7027ad..fecf83f 100644
--- a/plugins/clang/ide-clang-completion-provider.c
+++ b/plugins/clang/ide-clang-completion-provider.c
@@ -89,14 +89,12 @@ static gint
sort_by_priority (gconstpointer a,
gconstpointer b)
{
- CXCompletionResult *ra = ide_clang_completion_item_get_result (a);
- CXCompletionResult *rb = ide_clang_completion_item_get_result (b);
- unsigned prioa = clang_getCompletionPriority (ra->CompletionString);
- unsigned priob = clang_getCompletionPriority (rb->CompletionString);
+ IdeClangCompletionItem *itema = (IdeClangCompletionItem *)a;
+ IdeClangCompletionItem *itemb = (IdeClangCompletionItem *)b;
- if (prioa < priob)
+ if (itema->priority < itemb->priority)
return -1;
- else if (prioa > priob)
+ else if (itema->priority > itemb->priority)
return 1;
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]