From b07b10bdaa2cb2c585b0de8a1c666e37c95c32dd Mon Sep 17 00:00:00 2001 From: Evgeny Khramtsov Date: Thu, 29 Nov 2018 13:01:00 +0300 Subject: [PATCH] Drop some macros related to OTP<19 --- rebar.config | 4 ---- src/mod_block_strangers.erl | 22 +--------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/rebar.config b/rebar.config index a87ec0054..e033dd99c 100644 --- a/rebar.config +++ b/rebar.config @@ -94,10 +94,6 @@ {if_var_true, roster_gateway_workaround, {d, 'ROSTER_GATWAY_WORKAROUND'}}, {if_var_match, db_type, mssql, {d, 'mssql'}}, {if_var_true, elixir, {d, 'ELIXIR_ENABLED'}}, - {if_have_fun, {crypto, strong_rand_bytes, 1}, {d, 'STRONG_RAND_BYTES'}}, - {if_have_fun, {rand, uniform, 1}, {d, 'RAND_UNIFORM'}}, - {if_have_fun, {gb_sets, iterator_from, 2}, {d, 'GB_SETS_ITERATOR_FROM'}}, - {if_have_fun, {public_key, short_name_hash, 1}, {d, 'SHORT_NAME_HASH'}}, {if_var_true, new_sql_schema, {d, 'NEW_SQL_SCHEMA'}}, {if_var_true, hipe, native}, {src_dirs, [src, diff --git a/src/mod_block_strangers.erl b/src/mod_block_strangers.erl index 6e9d1097a..0496245b0 100644 --- a/src/mod_block_strangers.erl +++ b/src/mod_block_strangers.erl @@ -222,31 +222,11 @@ check_subscription(From, To) -> end. sets_bare_member({U, S, <<"">>} = LBJID, Set) -> - case ?SETS:next(sets_iterator_from(LBJID, Set)) of + case ?SETS:next(?SETS:iterator_from(LBJID, Set)) of {{U, S, _}, _} -> true; _ -> false end. --ifdef(GB_SETS_ITERATOR_FROM). -sets_iterator_from(Element, Set) -> - ?SETS:iterator_from(Element, Set). --else. -%% Copied from gb_sets.erl -%% TODO: Remove after dropping R17 support -sets_iterator_from(S, {_, T}) -> - iterator_from(S, T, []). - -iterator_from(S, {K, _, T}, As) when K < S -> - iterator_from(S, T, As); -iterator_from(_, {_, nil, _} = T, As) -> - [T | As]; -iterator_from(S, {_, L, _} = T, As) -> - iterator_from(S, L, [T | As]); -iterator_from(_, nil, As) -> - As. --endif. - - depends(_Host, _Opts) -> [].