diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-03-31 11:01:12 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-04-16 08:02:06 (GMT) |
commit | 3e56a4a367c34f032cb8ef225251e330028de650 (patch) | |
tree | d6767a17987b3a8bee6943ea5fe9270ab0d151b8 | |
parent | 68045615d311c3cb8bcaaaf84b4c8ca52a0fccd0 (diff) | |
download | Qt-3e56a4a367c34f032cb8ef225251e330028de650.zip Qt-3e56a4a367c34f032cb8ef225251e330028de650.tar.gz Qt-3e56a4a367c34f032cb8ef225251e330028de650.tar.bz2 |
Experimental fix for speeding up QResource::name()...
-rw-r--r-- | src/corelib/io/qresource.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index dd24cde..3bdb352 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -574,8 +574,14 @@ inline QString QResourceRoot::name(int node) const (names[name_offset+1] << 0); name_offset += 2; name_offset += 4; //jump past hash - for(int i = 0; i < name_length*2; i+=2) - ret += QChar(names[name_offset+i+1], names[name_offset+i]); + + ret.resize(name_length); + QChar *strData = ret.data(); + for(int i = 0; i < name_length*2; i+=2) { + QChar c(names[name_offset+i+1], names[name_offset+i]); + *strData = c; + ++strData; + } return ret; } |