File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,11 @@ unregister(Class, TypeName) ->
4646% % can throw a badarg, indicating that the type cannot have been
4747% % registered.
4848binary_to_type (TypeBin ) when is_binary (TypeBin ) ->
49- case catch list_to_existing_atom (binary_to_list (TypeBin )) of
50- {'EXIT' , {badarg , _ }} -> {error , not_found };
51- TypeAtom -> TypeAtom
49+ case catch binary_to_existing_atom (TypeBin ) of
50+ {'EXIT' , {badarg , _ }} ->
51+ {error , not_found };
52+ TypeAtom ->
53+ TypeAtom
5254 end .
5355
5456lookup_module (Class , T ) when is_atom (T ) ->
@@ -65,7 +67,7 @@ lookup_all(Class) ->
6567% %---------------------------------------------------------------------------
6668
6769internal_binary_to_type (TypeBin ) when is_binary (TypeBin ) ->
68- list_to_atom ( binary_to_list ( TypeBin ) ).
70+ binary_to_atom ( TypeBin ).
6971
7072internal_register (Class , TypeName , ModuleName )
7173 when is_atom (Class ), is_binary (TypeName ), is_atom (ModuleName ) ->
You can’t perform that action at this time.
0 commit comments