aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/dets.erl
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-01-23 21:26:22 +0100
committerRickard Green <[email protected]>2017-02-06 19:54:48 +0100
commit2a78349342b9f72651c016b650321bb317098a3c (patch)
treea859e377aa9426863fe381ef30bd940a2c7935dd /lib/stdlib/src/dets.erl
parent8d4dd97bcbd0988b08f8f8141ec7cfb17a16aa4a (diff)
downloadotp-2a78349342b9f72651c016b650321bb317098a3c.tar.gz
otp-2a78349342b9f72651c016b650321bb317098a3c.tar.bz2
otp-2a78349342b9f72651c016b650321bb317098a3c.zip
Use magic refs for compiled match specs
Diffstat (limited to 'lib/stdlib/src/dets.erl')
-rw-r--r--lib/stdlib/src/dets.erl7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/stdlib/src/dets.erl b/lib/stdlib/src/dets.erl
index 5bc9475fc8..e81383775b 100644
--- a/lib/stdlib/src/dets.erl
+++ b/lib/stdlib/src/dets.erl
@@ -1063,11 +1063,8 @@ foldl_bins([Bin | Bins], MP, Terms) ->
compile_match_spec(select, ?PATTERN_TO_OBJECT_MATCH_SPEC('_') = Spec) ->
{Spec, true};
compile_match_spec(select, Spec) ->
- case catch ets:match_spec_compile(Spec) of
- X when is_binary(X) ->
- {Spec, {match_spec, X}};
- _ ->
- badarg
+ try {Spec, {match_spec, ets:match_spec_compile(Spec)}}
+ catch error:_ -> badarg
end;
compile_match_spec(object, Pat) ->
compile_match_spec(select, ?PATTERN_TO_OBJECT_MATCH_SPEC(Pat));