[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdelibs/kdecore/config
From: Oswald Buddenhagen <ossi () kde ! org>
Date: 2008-04-27 6:23:15
Message-ID: 20080427062315.GA4942 () ugly ! local
[Download RAW message or body]
reviewing it again ...
On Mon, Apr 21, 2008 at 02:01:58PM +0000, Jakub Stachowski wrote:
> SVN commit 799413 by qbast:
>
> Ini parsing optimization - avoid using QByteArray and excessive memory copying.
>
> --- trunk/KDE/kdelibs/kdecore/config/kconfigini.cpp #799412:799413
> @@ -165,17 +174,17 @@
> if (groupOptionImmutable)
> entryOptions |= KEntryMap::EntryImmutable;
>
> BufferFragment locale;
> BufferFragment rawKey;
> int start;
> - while ((start = aKey.indexOf('[')) >= 0) {
> + while ((start = aKey.lastIndexOf('[')) >= 0) {
> int end = aKey.indexOf(']', start);
> @@ -188,8 +197,9 @@
> break;
> case 'd':
> entryOptions |= KEntryMap::EntryDeleted;
> - aKey = printableToString(aKey.left(start), file, \
> lineNo);
> - entryMap.setEntry(currentGroup, aKey, \
> QByteArray(), entryOptions); + aKey = \
> aKey.left(start); + printableToString(&aKey, file, \
> lineNo); + entryMap.setEntry(currentGroup, \
> aKey.toByteArray(), QByteArray(), entryOptions); goto next_line;
> default:
> break;
> @@ -203,17 +213,16 @@
> goto next_line;
> }
>
> locale = aKey.mid(start + 1,end - start - 1);
> rawKey = aKey.left(end + 1);
> }
> - aKey.remove(start, end-start+1);
> + aKey.truncate(start);
> }
>
i *think* you broke the case where the immutability marker comes before
the locale marker:
Key[$i][de_DE]=foo
care to craft a test?
--
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Confusion, chaos, panic - my work here is done.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic