Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Core Modules
dune-common
Commits
c6e7ae4e
Commit
c6e7ae4e
authored
15 years ago
by
Jorrit Fahlke
Browse files
Options
Downloads
Patches
Plain Diff
Don't loose precision when using the default value for a ConfigParser key.
[[Imported from SVN: r5909]]
parent
8af7c9ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/configparser.cc
+4
-5
4 additions, 5 deletions
dune/common/configparser.cc
with
4 additions
and
5 deletions
dune/common/configparser.cc
+
4
−
5
View file @
c6e7ae4e
...
...
@@ -231,11 +231,10 @@ int ConfigParser::get(const string& key, int defaultValue)
double
ConfigParser
::
get
(
const
string
&
key
,
double
defaultValue
)
{
stringstream
stream
;
stream
<<
defaultValue
;
string
ret
=
get
(
key
,
stream
.
str
());
return
atof
(
ret
.
c_str
());
if
(
hasKey
(
key
))
return
atof
((
*
this
)[
key
].
c_str
());
else
return
defaultValue
;
}
bool
ConfigParser
::
get
(
const
string
&
key
,
bool
defaultValue
)
...
...
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