[epiphany] ephy-history-window: correct asserts and g_return_if_fail



commit 7c2104174ab144d12001e646fd464522d5eef517
Author: Xan Lopez <xan igalia com>
Date:   Wed Mar 7 11:55:57 2012 +0100

    ephy-history-window: correct asserts and g_return_if_fail
    
    Don't assert parameters in public methods, don't g_return_if_fail
    parameters in private ones.

 src/ephy-history-window.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 506e704..2a46ec6 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -1310,12 +1310,11 @@ ephy_history_window_new (EphyHistoryService *history_service)
 {
 	EphyHistoryWindow *editor;
 
-	g_assert (history_service != NULL);
+	g_return_val_if_fail (history_service != NULL, NULL);
 
-	editor = EPHY_HISTORY_WINDOW (g_object_new
-			(EPHY_TYPE_HISTORY_WINDOW,
-			 "history-service", history_service,
-			 NULL));
+	editor = g_object_new (EPHY_TYPE_HISTORY_WINDOW,
+			       "history-service", history_service,
+			       NULL);
 
 	ephy_history_window_construct (editor);
 
@@ -1369,12 +1368,7 @@ ephy_history_window_init (EphyHistoryWindow *editor)
 static void
 ephy_history_window_dispose (GObject *object)
 {
-	EphyHistoryWindow *editor;
-
-	g_return_if_fail (object != NULL);
-	g_return_if_fail (EPHY_IS_HISTORY_WINDOW (object));
-
-	editor = EPHY_HISTORY_WINDOW (object);
+	EphyHistoryWindow *editor = EPHY_HISTORY_WINDOW (object);
 
 	if (editor->priv->hosts_view != NULL)
 	{



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