Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
cc869680
Commit
cc869680
authored
Jun 24, 2010
by
Oswald Buddenhagen
Browse files
optimize lookup of built-in replace functions
use lowercasing only as a fallback
parent
e5837686
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/shared/proparser/profileevaluator.cpp
View file @
cc869680
...
...
@@ -273,7 +273,7 @@ static struct {
QString
strforever
;
ProString
strTEMPLATE
;
ProString
strQMAKE_DIR_SEP
;
QHash
<
Q
String
,
int
>
expands
;
QHash
<
Pro
String
,
int
>
expands
;
QHash
<
ProString
,
int
>
functions
;
QHash
<
ProString
,
int
>
varList
;
QHash
<
ProString
,
ProString
>
varMap
;
...
...
@@ -340,7 +340,7 @@ void ProFileEvaluator::Private::initStatics()
{
"replace"
,
E_REPLACE
}
};
for
(
unsigned
i
=
0
;
i
<
sizeof
(
expandInits
)
/
sizeof
(
expandInits
[
0
]);
++
i
)
statics
.
expands
.
insert
(
QLatin1
String
(
expandInits
[
i
].
name
),
expandInits
[
i
].
func
);
statics
.
expands
.
insert
(
Pro
String
(
expandInits
[
i
].
name
),
expandInits
[
i
].
func
);
static
const
struct
{
const
char
*
const
name
;
...
...
@@ -1919,7 +1919,13 @@ ProStringList ProFileEvaluator::Private::evaluateExpandFunction(
ProStringList
ProFileEvaluator
::
Private
::
evaluateExpandFunction
(
const
ProString
&
func
,
const
ProStringList
&
args
)
{
ExpandFunc
func_t
=
ExpandFunc
(
statics
.
expands
.
value
(
func
.
toQString
(
m_tmp1
).
toLower
()));
ExpandFunc
func_t
=
ExpandFunc
(
statics
.
expands
.
value
(
func
));
if
(
func_t
==
0
)
{
const
QString
&
fn
=
func
.
toQString
(
m_tmp1
);
const
QString
&
lfn
=
fn
.
toLower
();
if
(
!
fn
.
isSharedWith
(
lfn
))
func_t
=
ExpandFunc
(
statics
.
expands
.
value
(
ProString
(
lfn
)));
}
ProStringList
ret
;
...
...
Write
Preview
Supports
Markdown
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