Doesn't fix getVectorFromString, but does reduce cpu usage thereafter.
Ok to apply?
Angus

Index: src/frontends/controllers/biblio.C
===================================================================
RCS file: 
/usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/biblio.C,v
retrieving revision 1.36
diff -u -p -r1.36 biblio.C
--- src/frontends/controllers/biblio.C  4 Nov 2002 02:12:32 -0000       1.36
+++ src/frontends/controllers/biblio.C  5 Nov 2002 11:51:44 -0000
@@ -163,7 +163,7 @@ string const familyName(string const & n
        if (fname[0] == '\\')
                return fname.substr(2);

-       return fname;
+       return rtrim(fname);
 }


@@ -201,19 +201,11 @@ string const getAbbreviatedAuthor(InfoMa
                return author;
        }

-       vector<string> authors = getVectorFromString(author, " and");
-
+       vector<string> const authors = getVectorFromString(author, " and ");
        if (!authors.empty()) {
-               author.erase();
-
-               for (vector<string>::iterator it = authors.begin();
-                    it != authors.end(); ++it) {
-                       *it = familyName(rtrim(*it));
-               }
-
-               author = authors[0];
+               author = familyName(authors[0]);
                if (authors.size() == 2)
-                       author += _(" and ") + authors[1];
+                       author += _(" and ") + familyName(authors[1]);
                else if (authors.size() > 2)
                        author += _(" et al.");
        }

Reply via email to