diff options
author | Björn Gustavsson <[email protected]> | 2019-01-18 05:53:48 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-01-18 05:53:48 +0100 |
commit | 277331c4823e10a7bbc723a7116cb5e26596a408 (patch) | |
tree | 0b8e01e74c653fb2d755576594dabdca2e8ae804 /lib/compiler | |
parent | ceb43f022dcb1f461c53773392a40a4afbc291cf (diff) | |
download | otp-277331c4823e10a7bbc723a7116cb5e26596a408.tar.gz otp-277331c4823e10a7bbc723a7116cb5e26596a408.tar.bz2 otp-277331c4823e10a7bbc723a7116cb5e26596a408.zip |
beam_ssa_type: Simplify is_singleton_type/1
Diffstat (limited to 'lib/compiler')
-rw-r--r-- | lib/compiler/src/beam_ssa_type.erl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl index 4ea3781783..ede57875e2 100644 --- a/lib/compiler/src/beam_ssa_type.erl +++ b/lib/compiler/src/beam_ssa_type.erl @@ -1218,10 +1218,8 @@ t_tuple_size(#t_tuple{size=Size,exact=true}) -> t_tuple_size(_) -> none. -is_singleton_type(#t_atom{elements=[_]}) -> true; -is_singleton_type(#t_integer{elements={V,V}}) -> true; -is_singleton_type(nil) -> true; -is_singleton_type(_) -> false. +is_singleton_type(Type) -> + get_literal_from_type(Type) =/= none. %% join(Type1, Type2) -> Type %% Return the "join" of Type1 and Type2. The join is a more general |