mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
A bunch of other minor issues reported by PVS-Studio
This commit is contained in:
parent
53f2364a86
commit
35ee96c4cb
7 changed files with 15 additions and 11 deletions
|
@ -70,6 +70,10 @@ std::unique_ptr<BloomFilter> BloomFilter::Unserialize(const broker::data& data)
|
|||
case Counting:
|
||||
bf = std::unique_ptr<BloomFilter>(new CountingBloomFilter());
|
||||
break;
|
||||
|
||||
default:
|
||||
reporter->Error("found invalid bloom filter type");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if ( ! bf->DoUnserialize((*v)[2]) )
|
||||
|
|
|
@ -158,7 +158,7 @@ double CardinalityCounter::Size() const
|
|||
answer = 1 / answer;
|
||||
answer = (alpha_m * m * m * answer);
|
||||
|
||||
if ( answer <= 5.0 * (m / 2) )
|
||||
if ( answer <= 5.0 * (((double)m) / 2) )
|
||||
return m * log(((double)m) / V);
|
||||
|
||||
else if ( answer <= (pow(2, 64) / 30) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue