[tracker] libtracker-miner: Fix nasty typo in TrackerPriorityQueue
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-miner: Fix nasty typo in TrackerPriorityQueue
- Date: Thu, 21 Jul 2011 15:43:36 +0000 (UTC)
commit 7d445afbbac3aca09f8c88bd80bb9922be5c534e
Author: Carlos Garnacho <carlos lanedo com>
Date: Thu Jul 21 17:28:55 2011 +0200
libtracker-miner: Fix nasty typo in TrackerPriorityQueue
binary search wasn't working quite ok, even though it wasn't really
noticeable in the most common case of having just 2 priorities in
the segments array.
src/libtracker-miner/tracker-priority-queue.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-priority-queue.c b/src/libtracker-miner/tracker-priority-queue.c
index a882c0a..d918f85 100644
--- a/src/libtracker-miner/tracker-priority-queue.c
+++ b/src/libtracker-miner/tracker-priority-queue.c
@@ -84,16 +84,16 @@ priority_segment_alloc_node (TrackerPriorityQueue *queue,
r = queue->segments->len - 1;
while (queue->segments->len > 0 && !found) {
- c = r + l / 2;
+ c = (r + l) / 2;
segment = &g_array_index (queue->segments, PrioritySegment, c);
if (segment->priority == priority) {
found = TRUE;
break;
} else if (segment->priority > priority) {
- l = c + 1;
- } else if (segment->priority < priority) {
r = c - 1;
+ } else if (segment->priority < priority) {
+ l = c + 1;
}
if (l > r) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]