From: Christian Persch Date: Sat, 5 Jun 2010 15:35:10 +0000 (+0200) Subject: Speed up large barcodes X-Git-Tag: glabels-2_3_0~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=245b69b5ed745eea8509133fd5c49a8bdde8082f;p=glabels Speed up large barcodes g_list_append() is evil. Just use prepend(). --- diff --git a/src/bc.c b/src/bc.c index f03b5841..842879cd 100644 --- a/src/bc.c +++ b/src/bc.c @@ -319,7 +319,7 @@ gl_barcode_add_shape (glBarcode *bc, g_return_if_fail (bc); g_return_if_fail (shape); - bc->shapes = g_list_append (bc->shapes, shape); + bc->shapes = g_list_prepend (bc->shapes, shape); } @@ -333,10 +333,10 @@ gl_barcode_get_styles_list (void) GList *list = NULL; for (i=0; backends[i].id != NULL; i++) { - list = g_list_append (list, g_strdup (gettext (backends[i].name))); + list = g_list_prepend (list, g_strdup (gettext (backends[i].name))); } - return list; + return g_list_reverse (list); }