mirror of
https://github.com/ZmnSCPxj/clboss.git
synced 2026-08-13 12:33:20 +02:00
fix: initialize ReservoirSampler::wsum to silence build warning
GCC's deeper inlining at -O2 detects that wsum may be used uninitialized when ReservoirSampler::add() is inlined into JitRebalancer. Debug builds (-Og) don't trigger this because GCC doesn't inline deeply enough. The value is overwritten on the first add() call, so this is purely to satisfy the compiler.
This commit is contained in:
parent
a17b83ce2d
commit
d90ca280ef
1 changed files with 2 additions and 2 deletions
|
|
@ -26,10 +26,10 @@ private:
|
|||
Weight wsum;
|
||||
|
||||
public:
|
||||
ReservoirSampler() : max_selected(1) { }
|
||||
ReservoirSampler() : max_selected(1), wsum(0) { }
|
||||
explicit
|
||||
ReservoirSampler(std::size_t max_selected_
|
||||
) : max_selected(max_selected_) { }
|
||||
) : max_selected(max_selected_), wsum(0) { }
|
||||
ReservoirSampler(ReservoirSampler&&) =default;
|
||||
ReservoirSampler(ReservoirSampler const&) =default;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue