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
1be08948
Commit
1be08948
authored
Aug 03, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #206 from groleo/master
removeRedundantWhiteSpace micro-optimization
parents
8eca4c66
d4601735
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 @
1be08948
...
...
@@ -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