fix(ds): Fix hashing of empty wildcard topic levels in bitfield_lts

This commit is contained in:
ieQu1 2024-06-29 15:49:42 +02:00
parent 91fd01ed21
commit b565976794
No known key found for this signature in database
GPG Key ID: 488654DF3FED6FDE
1 changed files with 3 additions and 1 deletions

View File

@ -596,7 +596,7 @@ prepare_loop_context(DB, CF, TopicIndex, StartTime, SafeCutoffTime, Varying, Key
fun
('+') ->
any;
(TopicLevel) when is_binary(TopicLevel) ->
(TopicLevel) when is_binary(TopicLevel); TopicLevel =:= '' ->
{'=', hash_topic_level(TopicLevel)}
end,
Varying
@ -831,6 +831,8 @@ threshold_fun(0) ->
threshold_fun(_) ->
20.
hash_topic_level('') ->
hash_topic_level(<<>>);
hash_topic_level(TopicLevel) ->
<<Int:64, _/binary>> = erlang:md5(TopicLevel),
Int.