Georg Baum wrote:
Abdelrazak Younes wrote:

Georg Baum wrote:
I would be more concerned about resizing by append(). Why don't you do
this?

QString const ucs4_to_qstring(char_type const * str, size_t ls)
{
        QString s;
        s.reserve(ls);
        for (size_t i = 0; i < ls; ++i)
                s.append(ucs4_to_qchar(str[i]);
        return s;
}

(assuming that QString has a reserve() member, I don't know)
It has but it makes no difference anyway.

Then I don't understand why it is slow, it should basicaly be not much more than a memcpy. I guess in order to understand why you have to step through
this with the debugger.

Note that I didn't say that it is slow, Andre did. I was just investigating why it could be slow. Some of the solutions offered in this thread (the resrve() amd/or the inlining) may very well bring a speed advantage on Linux; I am just saying that there's no improvement in Windows.

Abdel.

Reply via email to