Allow ignore non-binary subkey for hash
This allows the subkey to be an integer, that will be gnored for hashing purposes
This commit is contained in:
parent
b81caf7dee
commit
c1cd00b498
1 changed files with 3 additions and 3 deletions
|
@ -97,12 +97,12 @@ segment_hash(Key) when is_binary(Key) ->
|
|||
segment_hash({?RIAK_TAG, Bucket, Key, null})
|
||||
when is_binary(Bucket), is_binary(Key) ->
|
||||
segment_hash(<<Bucket/binary, Key/binary>>);
|
||||
segment_hash({?HEAD_TAG, Bucket, Key, null})
|
||||
when is_binary(Bucket), is_binary(Key) ->
|
||||
segment_hash(<<Bucket/binary, Key/binary>>);
|
||||
segment_hash({?HEAD_TAG, Bucket, Key, SubK})
|
||||
when is_binary(Bucket), is_binary(Key), is_binary(SubK) ->
|
||||
segment_hash(<<Bucket/binary, Key/binary, SubK/binary>>);
|
||||
segment_hash({?HEAD_TAG, Bucket, Key, _SubK})
|
||||
when is_binary(Bucket), is_binary(Key) ->
|
||||
segment_hash(<<Bucket/binary, Key/binary>>);
|
||||
segment_hash(Key) ->
|
||||
segment_hash(term_to_binary(Key)).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue