[perl-Glib-Object-Introspection] Refactor some code for clarity



commit 914bde49b8cb2957a898c8883ba669389da7a4ff
Author: Torsten SchÃnfeld <kaffeetisch gmx de>
Date:   Mon Jan 21 00:07:27 2013 +0100

    Refactor some code for clarity

 gperl-i11n-marshal-arg.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/gperl-i11n-marshal-arg.c b/gperl-i11n-marshal-arg.c
index f1a12e8..0d1bd38 100644
--- a/gperl-i11n-marshal-arg.c
+++ b/gperl-i11n-marshal-arg.c
@@ -195,17 +195,16 @@ arg_to_sv (GIArgument * arg,
 		return sv;
 	    }
 
-	    case GI_TYPE_TAG_GTYPE: {
-		/* GType == gsize */
+	    case GI_TYPE_TAG_GTYPE:
+	    {
+		GType gtype = arg->v_size;
 		const char *package;
-		if (G_TYPE_INVALID == arg->v_size || G_TYPE_NONE == arg->v_size)
+		if (G_TYPE_INVALID == gtype || G_TYPE_NONE == gtype)
 			return &PL_sv_undef;
-		package = gperl_package_from_type (arg->v_size);
+		package = gperl_package_from_type (gtype);
 		if (!package)
-			package = g_type_name (arg->v_size);
-		if (!package)
-			return &PL_sv_undef;
-		return newSVpv (package, PL_na);
+			package = g_type_name (gtype);
+		return package ? newSVpv (package, PL_na) : &PL_sv_undef;
 	    }
 
 	    case GI_TYPE_TAG_ARRAY:



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