[tracker/libtracker-bus: 8/44] libtracker-bus: Fix string retrieval in ArrayCursor



commit 68f625ecaa34c00d803e25db4e31a2478af69c46
Author: Jürg Billeter <j bitron ch>
Date:   Mon Jul 19 16:42:04 2010 +0200

    libtracker-bus: Fix string retrieval in ArrayCursor

 src/libtracker-bus/tracker-array-cursor.vala |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-array-cursor.vala b/src/libtracker-bus/tracker-array-cursor.vala
index 99abf86..25ab5fd 100644
--- a/src/libtracker-bus/tracker-array-cursor.vala
+++ b/src/libtracker-bus/tracker-array-cursor.vala
@@ -20,28 +20,22 @@
 internal class Tracker.Bus.ArrayCursor : Tracker.Sparql.Cursor {
 	int rows;
 	int current_row = -1;
-	char **results;
+	string[,] results;
 	int cols;
 
-	public ArrayCursor (owned char** results, int rows, int cols) {
+	public ArrayCursor (owned string[,] results, int rows, int cols) {
 		this.rows = rows;
 		this.cols = cols;
-		this.results = results;
+		this.results = (owned) results;
 	}
 
 	public override int n_columns { get { return cols; } }
 
 	public override unowned string? get_string (int column, out long length = null)
 	requires (current_row >= 0) {
-		char **row;
 		unowned string str;
 
-		if (rows < 1) {
-			return null;
-		}
-
-		row = results + current_row;
-		str = (string) row[column];
+		str = results[current_row, column];
 
 		if (&length != null) {
 			length = str.length;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]