Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
94fdbca9
Commit
94fdbca9
authored
Mar 01, 2017
by
Thomas Jahns
🤸
Browse files
Shorten branches with short-circuit evaluation.
parent
a42b43ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gribapi_utilities.c
View file @
94fdbca9
...
...
@@ -123,8 +123,8 @@ long gribGetLong(grib_handle* gh, const char* key)
long
gribGetLongDefault
(
grib_handle
*
gribHandle
,
const
char
*
key
,
long
defaultValue
)
{
long
result
;
if
(
grib_get_long
(
gribHandle
,
key
,
&
result
)
)
return
defaultValue
;
if
(
result
=
=
GRIB_MISSING_LONG
)
return
defaultValue
;
if
(
grib_get_long
(
gribHandle
,
key
,
&
result
)
||
result
==
GRIB_MISSING_LONG
)
result
=
defaultValue
;
return
result
;
}
...
...
@@ -140,8 +140,9 @@ double gribGetDouble(grib_handle* gh, const char* key)
double
gribGetDoubleDefault
(
grib_handle
*
gribHandle
,
const
char
*
key
,
double
defaultValue
)
{
double
result
;
if
(
grib_get_double
(
gribHandle
,
key
,
&
result
))
return
defaultValue
;
if
(
IS_EQUAL
(
result
,
GRIB_MISSING_DOUBLE
))
return
defaultValue
;
if
(
grib_get_double
(
gribHandle
,
key
,
&
result
)
||
IS_EQUAL
(
result
,
GRIB_MISSING_DOUBLE
)
)
result
=
defaultValue
;
return
result
;
}
...
...
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