[tracker/class-signal] libtracker-data: class-signal: Squash with previous commit, this is the right one
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/class-signal] libtracker-data: class-signal: Squash with previous commit, this is the right one
- Date: Tue, 31 Aug 2010 15:50:13 +0000 (UTC)
commit e26b3d8f52b9a11799f4ee30a3ceeccb036314f5
Author: Philip Van Hoof <philip codeminded be>
Date: Tue Aug 31 17:49:49 2010 +0200
libtracker-data: class-signal: Squash with previous commit, this is the right one
src/libtracker-data/tracker-class.c | 32 ++++++++++++++------------------
1 files changed, 14 insertions(+), 18 deletions(-)
---
diff --git a/src/libtracker-data/tracker-class.c b/src/libtracker-data/tracker-class.c
index 5cdb1b6..7486032 100644
--- a/src/libtracker-data/tracker-class.c
+++ b/src/libtracker-data/tracker-class.c
@@ -613,7 +613,7 @@ insert_vals_into_arrays (GArray *sub_pred_ids,
gint pred_id,
gint object_id)
{
- guint i, j, k;
+ gint i, j, k;
gint64 tmp;
gint64 sub_pred_id;
gint64 obj_graph_id;
@@ -624,26 +624,22 @@ insert_vals_into_arrays (GArray *sub_pred_ids,
obj_graph_id = obj_graph_id << 32 | graph_id;
i = 0;
+ j = sub_pred_ids->len - 1;
- if (sub_pred_ids->len != 0) {
- j = sub_pred_ids->len - 1;
- while (j - i > 0) {
- k = (i + j) / 2;
- tmp = g_array_index (sub_pred_ids, gint64, k);
- if (tmp == sub_pred_id) {
- j = k + 1;
- break;
- } else if (tmp > sub_pred_id)
- j = k;
- else
- i = k + 1;
- }
- } else {
- j = sub_pred_ids->len;
+ while (j - i > 0) {
+ k = (i + j) / 2;
+ tmp = g_array_index (sub_pred_ids, gint64, k);
+ if (tmp == sub_pred_id) {
+ i = k + 1;
+ break;
+ } else if (tmp > sub_pred_id)
+ j = k;
+ else
+ i = k + 1;
}
- g_array_insert_val (sub_pred_ids, j, sub_pred_id);
- g_array_insert_val (obj_graph_ids, j, obj_graph_id);
+ g_array_insert_val (sub_pred_ids, i, sub_pred_id);
+ g_array_insert_val (obj_graph_ids, i, obj_graph_id);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]