changeset 606:408f36d536a5

search_status_update(): slightly reduce code redundancy.
author zas_
date Thu, 08 May 2008 20:21:03 +0000
parents 651ae2be1031
children 6c331d0ba9b6
files src/search.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Thu May 08 12:50:25 2008 +0000
+++ b/src/search.c	Thu May 08 20:21:03 2008 +0000
@@ -266,26 +266,25 @@
 	gint64 t_bytes;
 	gint64 s_bytes;
 	gchar *tt;
-	gchar *ts;
 
 	t = search_result_count(sd, &t_bytes);
 	s = search_result_selection_count(sd, &s_bytes);
+	
+	tt = text_from_size_abrev(t_bytes);
 
 	if (s > 0)
 		{
-		tt = text_from_size_abrev(t_bytes);
-		ts = text_from_size_abrev(s_bytes);
+		gchar *ts = text_from_size_abrev(s_bytes);
 		buf = g_strdup_printf(_("%s, %d files (%s, %d)"), tt, t, ts, s);
-		g_free(tt);
 		g_free(ts);
 		}
 	else
 		{
-		tt = text_from_size_abrev(t_bytes);
 		buf = g_strdup_printf(_("%s, %d files"), tt, t);
-		g_free(tt);
 		}
 
+	g_free(tt);
+
 	gtk_label_set_text(GTK_LABEL(sd->label_status), buf);
 	g_free(buf);
 }