[libgdata] core: Refactor assertions slightly



commit 50d349ae3ee8447cdb88fe87cd84c09095ff37e3
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Jul 8 15:33:11 2013 +0100

    core: Refactor assertions slightly
    
    This tidies up the code a bit. No behavioural changes.

 gdata/gdata-service.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index 7ae2462..b393be9 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -1286,10 +1286,9 @@ gdata_service_insert_entry_finish (GDataService *self, GAsyncResult *async_resul
                return NULL;
 
        entry = g_simple_async_result_get_op_res_gpointer (result);
-       if (entry != NULL)
-               return g_object_ref (entry);
+       g_assert (entry != NULL);
 
-       g_assert_not_reached ();
+       return g_object_ref (entry);
 }
 
 /**
@@ -1482,10 +1481,9 @@ gdata_service_update_entry_finish (GDataService *self, GAsyncResult *async_resul
                return NULL;
 
        entry = g_simple_async_result_get_op_res_gpointer (result);
-       if (entry != NULL)
-               return g_object_ref (entry);
+       g_assert (entry != NULL);
 
-       g_assert_not_reached ();
+       return g_object_ref (entry);
 }
 
 /**


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