[Goodies-commits] r5679 - xfbib/branches/gobject/src

Jesper Karlsson zarper at xfce.org
Sat Oct 18 19:43:59 CEST 2008


Author: zarper
Date: 2008-10-18 17:43:59 +0000 (Sat, 18 Oct 2008)
New Revision: 5679

Modified:
   xfbib/branches/gobject/src/xfbib-bibtex.c
Log:
Optimizing the for-loop.


Modified: xfbib/branches/gobject/src/xfbib-bibtex.c
===================================================================
--- xfbib/branches/gobject/src/xfbib-bibtex.c	2008-10-18 17:26:14 UTC (rev 5678)
+++ xfbib/branches/gobject/src/xfbib-bibtex.c	2008-10-18 17:43:59 UTC (rev 5679)
@@ -121,7 +121,7 @@
 gboolean
 xfbib_bibtex_parse(XfbibBibtex *elements, const gchar *str)
 {
-	gint i;
+	gint i, len;
 	GRegex *regex;
 	GObject *obj;
 	GString *buf;
@@ -132,8 +132,9 @@
 	regex = g_regex_new("^@(article|book|booklet|conference|inbook|incollection|inproceedings|manual|"
 			"mastersthesis|misc|phdthesis|proceedings|techreport|unpublished)({|\\s|[(])",
 			G_REGEX_CASELESS, 0, NULL);
-
-	for (i = 0; i < strlen(str); i++) {
+	
+	len = strlen(str);
+	for (i = 0; i < len; i++) {
 		if (str[i] == '@') {
 			if (buf->len > 0) {
 				/* The comment ended put it in the list */




More information about the Goodies-commits mailing list