File tree 2 files changed +5
-5
lines changed
src/transforms/tag_cardinality_limit
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,11 @@ impl TagCardinalityLimit {
55
55
}
56
56
57
57
// Tag value not yet part of the accepted set.
58
- if tag_value_set. len ( ) < self . config . value_limit as usize {
58
+ if tag_value_set. len ( ) < self . config . value_limit {
59
59
// accept the new value
60
60
tag_value_set. insert ( value. clone ( ) ) ;
61
61
62
- if tag_value_set. len ( ) == self . config . value_limit as usize {
62
+ if tag_value_set. len ( ) == self . config . value_limit {
63
63
emit ! ( TagCardinalityValueLimitReached { key } ) ;
64
64
}
65
65
@@ -76,7 +76,7 @@ impl TagCardinalityLimit {
76
76
self . accepted_tags
77
77
. get ( key)
78
78
. map ( |value_set| {
79
- !value_set. contains ( value) && value_set. len ( ) >= self . config . value_limit as usize
79
+ !value_set. contains ( value) && value_set. len ( ) >= self . config . value_limit
80
80
} )
81
81
. unwrap_or ( false )
82
82
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ impl fmt::Debug for TagValueSetStorage {
27
27
impl AcceptedTagValueSet {
28
28
pub fn new ( value_limit : usize , mode : & Mode ) -> Self {
29
29
let storage = match & mode {
30
- Mode :: Exact => TagValueSetStorage :: Set ( HashSet :: with_capacity ( value_limit as usize ) ) ,
30
+ Mode :: Exact => TagValueSetStorage :: Set ( HashSet :: with_capacity ( value_limit) ) ,
31
31
Mode :: Probabilistic ( config) => {
32
32
let num_bits = config. cache_size_per_key / 8 ; // Convert bytes to bits
33
33
TagValueSetStorage :: Bloom ( BloomFilter :: with_size ( num_bits) )
@@ -39,7 +39,7 @@ impl AcceptedTagValueSet {
39
39
pub fn contains ( & self , value : & TagValueSet ) -> bool {
40
40
match & self . storage {
41
41
TagValueSetStorage :: Set ( set) => set. contains ( value) ,
42
- TagValueSetStorage :: Bloom ( bloom) => bloom. contains ( & value) ,
42
+ TagValueSetStorage :: Bloom ( bloom) => bloom. contains ( value) ,
43
43
}
44
44
}
45
45
You can’t perform that action at this time.
0 commit comments