mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 10:51:52 -04:00
pfrd: fix mod by zero error when all branches are filtered
This commit is contained in:
parent
859b4da3dc
commit
098f353bf1
3 changed files with 9 additions and 0 deletions
|
|
@ -155,6 +155,9 @@ namespace eppfrd
|
|||
uint64_t idx;
|
||||
uint64_t threshold;
|
||||
|
||||
if(sum_ == 0)
|
||||
return NULL;
|
||||
|
||||
idx = 0;
|
||||
threshold = RND::rand64(sum_);
|
||||
for(size_t i = 0; i < branchinfo_.size(); i++)
|
||||
|
|
|
|||
|
|
@ -114,6 +114,9 @@ namespace msppfrd
|
|||
uint64_t idx;
|
||||
uint64_t threshold;
|
||||
|
||||
if(sum_ == 0)
|
||||
return NULL;
|
||||
|
||||
idx = 0;
|
||||
threshold = RND::rand64(sum_);
|
||||
for(size_t i = 0; i < branchinfo_.size(); i++)
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ namespace pfrd
|
|||
uint64_t idx;
|
||||
uint64_t threshold;
|
||||
|
||||
if(sum_ == 0)
|
||||
return NULL;
|
||||
|
||||
idx = 0;
|
||||
threshold = RND::rand64(sum_);
|
||||
for(size_t i = 0; i < branchinfo_.size(); i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue