From d4601735b582b903f1ccb144f59b2030a7797b05 Mon Sep 17 00:00:00 2001 From: Adrian Negreanu Date: Fri, 25 Jul 2014 12:36:05 +0300 Subject: removeRedundantWhiteSpace micro-optimization Signed-off-by: Adrian Negreanu --- src/util.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 0113e62..4cd680d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1667,10 +1667,11 @@ QCString removeRedundantWhiteSpace(const QCString &s) uint l=s.length(); uint csp=0; uint vsp=0; + char c; for (i=0;i0 && - ((isId(s.at(i)) && s.at(i-1)==')') || - (s.at(i)=='\'' && s.at(i-1)==' ') + else if (i>0 && + ( + (s.at(i-1)==')' && isId(c)) + || + (c=='\'' && s.at(i-1)==' ') ) ) { growBuf.addChar(' '); - growBuf.addChar(s.at(i)); + growBuf.addChar(c); } else if (c=='t' && csp==5 /*&& (i<5 || !isId(s.at(i-5)))*/ && !(isId(s.at(i+1)) /*|| s.at(i+1)==' '*/ || -- cgit v0.12