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) ->
46
46
% % can throw a badarg, indicating that the type cannot have been
47
47
% % registered.
48
48
binary_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
52
54
end .
53
55
54
56
lookup_module (Class , T ) when is_atom (T ) ->
@@ -65,7 +67,7 @@ lookup_all(Class) ->
65
67
% %---------------------------------------------------------------------------
66
68
67
69
internal_binary_to_type (TypeBin ) when is_binary (TypeBin ) ->
68
- list_to_atom ( binary_to_list ( TypeBin ) ).
70
+ binary_to_atom ( TypeBin ).
69
71
70
72
internal_register (Class , TypeName , ModuleName )
71
73
when is_atom (Class ), is_binary (TypeName ), is_atom (ModuleName ) ->
You can’t perform that action at this time.
0 commit comments