fix
This commit is contained in:
parent
4489bdd79c
commit
fc338360b9
@ -145,15 +145,17 @@ match_topic(Topic0, Topic1) ->
|
||||
%% *表示单级匹配,+表示多级匹配;+只能出现一次,并且只能在末尾
|
||||
|
||||
-spec match_components(list(), list()) -> boolean().
|
||||
match_components([<<$+>>], [_|_]) ->
|
||||
match_components(A, B) when is_list(A), is_list(B) ->
|
||||
match_components(A, B, false).
|
||||
match_components([<<"+">>], [_|_], _) ->
|
||||
true;
|
||||
match_components([], []) ->
|
||||
match_components([], [], _) ->
|
||||
true;
|
||||
match_components([<<$*>>|T0], [_|T1]) ->
|
||||
match_components(T0, T1);
|
||||
match_components([C0|T0], [C0|T1]) ->
|
||||
match_components(T0, T1);
|
||||
match_components(_, _) ->
|
||||
match_components([<<"*">>|T0], [_|T1], _) ->
|
||||
match_components(T0, T1, false);
|
||||
match_components([C0|T0], [C0|T1], _) ->
|
||||
match_components(T0, T1, false);
|
||||
match_components(_, _, _) ->
|
||||
false.
|
||||
|
||||
-spec of_components(Topic :: binary()) -> [binary()].
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user