[gnome-builder] egg-task-cache: fix sort order for priority heap
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] egg-task-cache: fix sort order for priority heap
- Date: Thu, 14 May 2015 03:17:42 +0000 (UTC)
commit 8a99282cba5cbd319bf35024a6cc049133d9623e
Author: Christian Hergert <christian hergert me>
Date: Wed May 13 20:17:33 2015 -0700
egg-task-cache: fix sort order for priority heap
The heap works the opposite of natural number sorting. Highest priority
wins. So we need to invert our compare to ensure the lowest (soonest)
cache item will be evicted first.
contrib/egg/egg-task-cache.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/contrib/egg/egg-task-cache.c b/contrib/egg/egg-task-cache.c
index 8508622..f05b4c6 100644
--- a/contrib/egg/egg-task-cache.c
+++ b/contrib/egg/egg-task-cache.c
@@ -182,7 +182,7 @@ cache_item_compare_evict_at (gconstpointer a,
const CacheItem *ci1 = a;
const CacheItem *ci2 = b;
- return ci1->evict_at - ci2->evict_at;
+ return ci2->evict_at - ci1->evict_at;
}
static CacheItem *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]