From 277331c4823e10a7bbc723a7116cb5e26596a408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 18 Jan 2019 05:53:48 +0100 Subject: beam_ssa_type: Simplify is_singleton_type/1 --- lib/compiler/src/beam_ssa_type.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/compiler/src') 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 -- cgit v1.2.3