diff options
author | Björn Gustavsson <[email protected]> | 2014-12-03 08:09:04 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-01-12 12:22:56 +0100 |
commit | b718f376519c89c60805b26efb54b4c4b5b8b908 (patch) | |
tree | e4c01094dcc994b47806319ef36f2786a24d3d1a /lib/tools/test | |
parent | 0aaff8007df99512acb300f610283523d9f05945 (diff) | |
download | otp-b718f376519c89c60805b26efb54b4c4b5b8b908.tar.gz otp-b718f376519c89c60805b26efb54b4c4b5b8b908.tar.bz2 otp-b718f376519c89c60805b26efb54b4c4b5b8b908.zip |
asn1ct_parser2: Eliminate all uses of old-style 'catch'
Most uses of 'catch' are not necessary. For example,
parse_or/2 is typically called like this:
case catch parse_or(Tokens, Flist) of
{'EXIT',Reason} ->
exit(Reason);
{asn1_error,_}=AsnErr ->
throw(AsnErr);
Result ->
Result
end.
Since {asn1_error,_} is always thrown (never returned) and
a successful is always returned (never thrown), the 'case' and
the 'catch' are not necessary. The code can be simplified too:
parse_or(Tokens, Flist)
In a few cases, we will need to replace the 'catch' with
'try'...'catch'.
Diffstat (limited to 'lib/tools/test')
0 files changed, 0 insertions, 0 deletions