Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
d4601735
Commit
d4601735
authored
Jul 25, 2014
by
Adrian Negreanu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removeRedundantWhiteSpace micro-optimization
Signed-off-by:
Adrian Negreanu
<
adrian.m.negreanu@intel.com
>
parent
c9d816aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
util.cpp
src/util.cpp
+9
-6
No files found.
src/util.cpp
View file @
d4601735
...
...
@@ -1667,10 +1667,11 @@ QCString removeRedundantWhiteSpace(const QCString &s)
uint
l
=
s
.
length
();
uint
csp
=
0
;
uint
vsp
=
0
;
char
c
;
for
(
i
=
0
;
i
<
l
;
i
++
)
{
nextChar:
c
har
c
=
s
.
at
(
i
);
c
=
s
.
at
(
i
);
// search for "const"
if
(
csp
<
6
&&
c
==
constScope
[
csp
]
&&
// character matches substring "const"
...
...
@@ -1705,7 +1706,7 @@ nextChar:
if
(
cc
==
'\\'
)
// escaped character
{
growBuf
.
addChar
(
s
.
at
(
i
+
1
));
i
+=
2
;
i
+=
2
;
}
else
if
(
cc
==
'"'
)
// end of string
{
i
++
;
goto
nextChar
;
}
...
...
@@ -1737,14 +1738,16 @@ nextChar:
growBuf
.
addChar
(
','
);
growBuf
.
addChar
(
' '
);
}
else
if
(
i
>
0
&&
((
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)==' '*/
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment