[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/util
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2009-06-07 9:41:06
Message-ID: 1244367666.490590.31978.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 978460 by ossi:

nicer

 M  +5 -7      kmacroexpander.cpp  


--- trunk/KDE/kdelibs/kdecore/util/kmacroexpander.cpp #978459:978460
@@ -217,11 +217,9 @@
     int sl, rsl, rpos;
     if (str[pos + 1] == QLatin1Char('{')) {
         rpos = pos + 2;
-        sl = str.indexOf(QLatin1Char('}'), rpos);
-        if (sl == -1)
+        if ((sl = str.indexOf(QLatin1Char('}'), rpos)) < 0)
             return 0;
-        else
-          sl -= rpos;
+        sl -= rpos;
         rsl = sl + 3;
     } else {
         rpos = pos + 1;
@@ -287,9 +285,9 @@
     int sl, rsl, rpos;
     if (str[pos + 1] == QLatin1Char('{')) {
         rpos = pos + 2;
-        for (sl = 0; str[rpos + sl] != QLatin1Char('}'); sl++)
-            if (rpos + sl >= str.length())
-                return 0;
+        if ((sl = str.indexOf(QLatin1Char('}'), rpos)) < 0)
+            return 0;
+        sl -= rpos;
         rsl = sl + 3;
     } else {
         rpos = pos + 1;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic