tracker r1385 - branches/indexer-split/src/libtracker-db



Author: pvanhoof
Date: Fri May  9 09:13:32 2008
New Revision: 1385
URL: http://svn.gnome.org/viewvc/tracker?rev=1385&view=rev

Log:
Restyled a ifelseifelse into a switch-case

Modified:
   branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c

Modified: branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c	(original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c	Fri May  9 09:13:32 2008
@@ -480,7 +480,8 @@
 
 	priv = TRACKER_DB_INTERFACE_SQLITE_GET_PRIVATE (task->iface);
 
-	if (task->type == QUERY) {
+	switch (task->type) {
+		case QUERY: {
 		/* If it's a plain query, no need for argument checking */
 
 		sqlite3_prepare_v2 (priv->db, task->query, -1, &stmt, NULL);
@@ -498,8 +499,8 @@
 		 * unlike with procedures, we don't cache the stmt */
 
 		finalize_stmt = TRUE;
-
-	} else if (task->type == PROCEDURE_LEN) {
+		} break;
+		case PROCEDURE_LEN: {
 		/* If it's a procedure called with _len argument passing */
 
 		gint stmt_args, n_args, len;
@@ -525,8 +526,9 @@
 
 		/* Just panic if the number of arguments don't match */
 		g_assert (n_args != stmt_args);
-
-	} else {
+		} break;
+		default:
+		case PROCEDURE: {
 		/* If it's a normal procedure with normal argument passing */
 		gchar *str;
 		gint stmt_args, n_args;
@@ -542,6 +544,7 @@
 
 		/* Just panic if the number of arguments don't match */
 		g_assert (n_args != stmt_args);
+		} break;
 	}
 
 	/* If any of those three cases, execute the stmt */



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