Skip to content

Commit

Permalink
3.14: remove guards in get_*_value/3
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesaimonetti committed Aug 27, 2014
1 parent 1374582 commit 3f91fc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/whistle-1.0.0/src/wh_json.erl
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ safe_cast(Value, Default, CastFun) ->
get_number_value(Key, JObj) ->
get_number_value(Key, JObj, 'undefined').

get_number_value(Key, JObj, Default) when is_number(Default) ->
get_number_value(Key, JObj, Default) ->
case get_value(Key, JObj) of
'undefined' -> Default;
Value -> safe_cast(Value, Default, fun wh_util:to_number/1)
Expand All @@ -420,7 +420,7 @@ get_number_value(Key, JObj, Default) when is_number(Default) ->
get_float_value(Key, JObj) ->
get_float_value(Key, JObj, 'undefined').

get_float_value(Key, JObj, Default) when is_float(Default) ->
get_float_value(Key, JObj, Default) ->
case get_value(Key, JObj) of
'undefined' -> Default;
Value -> safe_cast(Value, Default, fun wh_util:to_float/1)
Expand Down

0 comments on commit 3f91fc7

Please sign in to comment.