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
e5837686
Commit
e5837686
authored
Jun 23, 2010
by
Oswald Buddenhagen
Browse files
optimize: make map() return a const ref
parent
a49d1bff
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/shared/proparser/profileevaluator.cpp
View file @
e5837686
...
...
@@ -151,7 +151,7 @@ public:
void
visitProFunctionDef
(
ushort
tok
,
const
ProString
&
name
,
const
ushort
*
tokPtr
);
void
visitProVariable
(
ushort
tok
,
const
ProStringList
&
curr
,
const
ushort
*&
tokPtr
);
static
inline
ProString
map
(
const
ProString
&
var
);
static
inline
const
ProString
&
map
(
const
ProString
&
var
);
QHash
<
ProString
,
ProStringList
>
*
findValues
(
const
ProString
&
variableName
,
QHash
<
ProString
,
ProStringList
>::
Iterator
*
it
);
ProStringList
&
valuesRef
(
const
ProString
&
variableName
);
...
...
@@ -418,9 +418,10 @@ void ProFileEvaluator::Private::initStatics()
ProString
(
mapInits
[
i
].
newname
));
}
ProString
ProFileEvaluator
::
Private
::
map
(
const
ProString
&
var
)
const
ProString
&
ProFileEvaluator
::
Private
::
map
(
const
ProString
&
var
)
{
return
statics
.
varMap
.
value
(
var
,
var
);
QHash
<
ProString
,
ProString
>::
ConstIterator
it
=
statics
.
varMap
.
constFind
(
var
);
return
(
it
!=
statics
.
varMap
.
constEnd
())
?
it
.
value
()
:
var
;
}
...
...
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