From 3e56a4a367c34f032cb8ef225251e330028de650 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 31 Mar 2009 13:01:12 +0200 Subject: Experimental fix for speeding up QResource::name()... --- src/corelib/io/qresource.cpp | 10 ++++++++-- 1 file 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; } -- cgit v0.12