Improve impletament of emqttd_topic:match/2

This commit is contained in:
HeeeJianBo 2017-12-27 15:11:55 +08:00
parent d5c54276e2
commit 4c8b43e05d
1 changed files with 2 additions and 2 deletions

View File

@ -61,9 +61,9 @@ wildcard([_H|T]) ->
-spec(match(Name, Filter) -> boolean() when
Name :: topic() | words(),
Filter :: topic() | words()).
match(<<"$", _/binary>>, <<"+", _/binary>>) ->
match(<<$$, _/binary>>, <<$+, _/binary>>) ->
false;
match(<<"$", _/binary>>, <<"#", _/binary>>) ->
match(<<$$, _/binary>>, <<$#, _/binary>>) ->
false;
match(Name, Filter) when is_binary(Name) and is_binary(Filter) ->
match(words(Name), words(Filter));