Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
5ab254d5
Commit
5ab254d5
authored
14 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: drop dubious string::expand recursion
- was used for on-the-fly, but not needed anymore
parent
97a15a8b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/primitives/strings/string/string.C
+4
-10
4 additions, 10 deletions
src/OpenFOAM/primitives/strings/string/string.C
src/OpenFOAM/primitives/strings/string/string.H
+2
-5
2 additions, 5 deletions
src/OpenFOAM/primitives/strings/string/string.H
with
6 additions
and
15 deletions
src/OpenFOAM/primitives/strings/string/string.C
+
4
−
10
View file @
5ab254d5
...
...
@@ -93,8 +93,7 @@ Foam::string& Foam::string::replaceAll
}
// Expand all occurences of environment variables and initial tilde sequences
Foam
::
string
&
Foam
::
string
::
expand
(
const
bool
recurse
,
const
bool
allowEmptyVar
)
Foam
::
string
&
Foam
::
string
::
expand
(
const
bool
allowEmpty
)
{
size_type
begVar
=
0
;
...
...
@@ -134,20 +133,15 @@ Foam::string& Foam::string::expand(const bool recurse, const bool allowEmptyVar)
if
(
endVar
!=
npos
&&
endVar
!=
begVar
)
{
string
varName
=
substr
const
string
varName
=
substr
(
begVar
+
1
+
delim
,
endVar
-
begVar
-
2
*
delim
);
string
varValue
=
getEnv
(
varName
);
const
string
varValue
=
getEnv
(
varName
);
if
(
varValue
.
size
())
{
if
(
recurse
)
{
varValue
.
expand
(
recurse
,
allowEmptyVar
);
}
std
::
string
::
replace
(
begVar
,
...
...
@@ -156,7 +150,7 @@ Foam::string& Foam::string::expand(const bool recurse, const bool allowEmptyVar)
);
begVar
+=
varValue
.
size
();
}
else
if
(
allowEmpty
Var
)
else
if
(
allowEmpty
)
{
std
::
string
::
replace
(
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/primitives/strings/string/string.H
+
2
−
5
View file @
5ab254d5
...
...
@@ -180,13 +180,10 @@ public:
// - leading "~user" : home directory for specified user
// - leading "~OpenFOAM" : site/user OpenFOAM configuration directory
//
// Any unknown entries are removed silently if allowEmpty is true
// \sa
// Foam::findEtcFile
string
&
expand
(
const
bool
recurse
=
false
,
const
bool
allowEmptyVar
=
false
);
string
&
expand
(
const
bool
allowEmpty
=
false
);
//- Remove repeated characters returning true if string changed
bool
removeRepeated
(
const
char
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment