From 245b69b5ed745eea8509133fd5c49a8bdde8082f Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 5 Jun 2010 17:35:10 +0200 Subject: [PATCH] Speed up large barcodes g_list_append() is evil. Just use prepend(). --- src/bc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } -- 2.39.5