From aea8d2664195b8d5b6b77817a70c5955f9f32a8c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Jun 2010 11:55:22 -0500 Subject: Optimizing the one item in the collection case (common for shortcuts) --- tools/dbusmenu-dumper.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/dbusmenu-dumper.c b/tools/dbusmenu-dumper.c index 6af344d..f0f4ba0 100644 --- a/tools/dbusmenu-dumper.c +++ b/tools/dbusmenu-dumper.c @@ -90,8 +90,14 @@ collection_dumper (const GValue * value, int depth) g_ptr_array_add(array, g_strdup_printf("\n%s]", space)); g_free(space); - - gchar * retstr = g_strjoinv(NULL, (gchar **)array->pdata); + + gchar * retstr = NULL; + if (array->len == 3) { + retstr = g_strdup_printf("[%s]", ((gchar *)array->pdata[1]) + depth + 1/*for newline*/); + } else { + retstr = g_strjoinv(NULL, (gchar **)array->pdata); + } + g_ptr_array_free(array, TRUE); return retstr; -- cgit v1.2.3