From d836a23ff6a7936d8a2cd17c1a7edbc2bcce3bea Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 8 May 2004 09:45:15 +0000 Subject: [PATCH] micro-optimization: path() is recursive, let's call it only once (I wonder why the static QString in KMFolderDir::path() doesn't introduce bugs though) svn path=/trunk/kdepim/; revision=309532 --- kmfolder.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kmfolder.cpp b/kmfolder.cpp index dd8b7e4fe..64f05118e 100644 --- a/kmfolder.cpp +++ b/kmfolder.cpp @@ -602,11 +602,12 @@ QString KMFolder::idString() const return ""; while ( folderNode->parent() ) folderNode = folderNode->parent(); - int pathLen = path().length() - folderNode->path().length(); - QString relativePath = path().right( pathLen ); + QString myPath = path(); + int pathLen = myPath.length() - folderNode->path().length(); + QString relativePath = myPath.right( pathLen ); if (!relativePath.isEmpty()) relativePath = relativePath.right( relativePath.length() - 1 ) + "/"; - QString escapedName = QString( name() ); + QString escapedName = name(); /* Escape [ and ] as they are disallowed for kconfig sections and that is what the idString is primarily used for. */ escapedName.replace( "[", "%(" );