Abdelrazak Younes wrote:
If you try out the document attached in bug 3561 (http://bugzilla.lyx.org/show_bug.cgi?id=3561) and View->Source, the Encoding::init() will take 40 seconds on my system.

With the attached patch, this goes down to 25 seconds.

Jose, Jurgen?


Abdel.




------------------------------------------------------------------------

Index: Encoding.cpp
===================================================================
--- Encoding.cpp        (revision 18303)
+++ Encoding.cpp        (working copy)
@@ -171,8 +171,9 @@
                // they do not have a direct representation as a single byte,
                // therefore we need to check all UCS4 code points.
                // This is expensive!
+               std::vector<char> eightbit;
                for (char_type c = 0; c < max_ucs4; ++c) {
-                       std::vector<char> const eightbit = ucs4_to_eightbit(&c, 
1, iconvName_);
+                       ucs4_to_multibytes(c, eightbit, iconvName_);
                        if (!eightbit.empty()) {
                                CharInfoMap::const_iterator const it = 
unicodesymbols.find(c);
                                if (it == unicodesymbols.end() || 
!it->second.force)

Reply via email to