From 8c76f74c376d8ced1742e59b8bee851502411124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 11 May 2016 06:59:15 +0200 Subject: beam_utils: Let code_at/2 fail if the label does not exist All callers only calls code_at/2 for existing labels and they don't handle the return value 'none'. --- lib/compiler/src/beam_utils.erl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/compiler') diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl index a96f2bdc65..dd3c2ff913 100644 --- a/lib/compiler/src/beam_utils.erl +++ b/lib/compiler/src/beam_utils.erl @@ -137,10 +137,7 @@ index_label(Lbl, Is0, Acc) -> %% Retrieve the code at the given label. code_at(L, Ll) -> - case gb_trees:lookup(L, Ll) of - {value,Code} -> Code; - none -> none - end. + gb_trees:get(L, Ll). %% bif_to_test(Bif, [Op], Fail) -> {test,Test,Fail,[Op]} %% Convert a BIF to a test. Fail if not possible. -- cgit v1.2.3