@@ -142,15 +142,16 @@ HllArray<A>* HllArray<A>::newHll(const void* bytes, size_t len, const A& allocat
142142 HllArray<A>* sketch = HllSketchImplFactory<A>::newHll (lgK, tgtHllType, startFullSizeFlag, allocator);
143143 sketch->putCurMin (curMin);
144144 sketch->putOutOfOrderFlag (oooFlag);
145- if (!oooFlag) sketch->putHipAccum (hip);
145+ if (!oooFlag) { sketch->putHipAccum (hip); }
146146 sketch->putKxQ0 (kxq0);
147147 sketch->putKxQ1 (kxq1);
148148 sketch->putNumAtCurMin (numAtCurMin);
149149
150150 std::memcpy (sketch->hllByteArr_ .data (), data + hll_constants::HLL_BYTE_ARR_START , arrayBytes);
151151
152- if (auxHashMap != nullptr )
152+ if (auxHashMap != nullptr ) {
153153 ((Hll4Array<A>*)sketch)->putAuxHashMap (auxHashMap);
154+ }
154155
155156 aux_ptr.release ();
156157 return sketch;
@@ -193,7 +194,7 @@ HllArray<A>* HllArray<A>::newHll(std::istream& is, const A& allocator) {
193194 const auto hip = read<double >(is);
194195 const auto kxq0 = read<double >(is);
195196 const auto kxq1 = read<double >(is);
196- if (!oooFlag) sketch->putHipAccum (hip);
197+ if (!oooFlag) { sketch->putHipAccum (hip); }
197198 sketch->putKxQ0 (kxq0);
198199 sketch->putKxQ1 (kxq1);
199200
@@ -209,8 +210,7 @@ HllArray<A>* HllArray<A>::newHll(std::istream& is, const A& allocator) {
209210 ((Hll4Array<A>*)sketch)->putAuxHashMap (auxHashMap);
210211 }
211212
212- if (!is.good ())
213- throw std::runtime_error (" error reading from std::istream" );
213+ if (!is.good ()) { throw std::runtime_error (" error reading from std::istream" ); }
214214
215215 return sketch_ptr.release ();
216216}
@@ -545,7 +545,7 @@ template<typename A>
545545void HllArray<A>::hipAndKxQIncrementalUpdate(uint8_t oldValue, uint8_t newValue) {
546546 const uint32_t configK = 1 << this ->getLgConfigK ();
547547 // update hip BEFORE updating kxq
548- if (!oooFlag_) hipAccum_ += configK / (kxq0_ + kxq1_);
548+ if (!oooFlag_) { hipAccum_ += configK / (kxq0_ + kxq1_); }
549549 // update kxq0 and kxq1; subtract first, then add
550550 if (oldValue < 32 ) { kxq0_ -= INVERSE_POWERS_OF_2 [oldValue]; }
551551 else { kxq1_ -= INVERSE_POWERS_OF_2 [oldValue]; }
@@ -648,7 +648,7 @@ array_(array), array_size_(array_size), index_(index), hll_type_(hll_type), exce
648648{
649649 while (index_ < array_size_) {
650650 value_ = get_value (array_, index_, hll_type_, exceptions_, offset_);
651- if (all_ || value_ != hll_constants::EMPTY ) break ;
651+ if (all_ || value_ != hll_constants::EMPTY ) { break ; }
652652 ++index_;
653653 }
654654}
@@ -657,7 +657,7 @@ template<typename A>
657657typename HllArray<A>::const_iterator& HllArray<A>::const_iterator::operator ++() {
658658 while (++index_ < array_size_) {
659659 value_ = get_value (array_, index_, hll_type_, exceptions_, offset_);
660- if (all_ || value_ != hll_constants::EMPTY ) break ;
660+ if (all_ || value_ != hll_constants::EMPTY ) { break ; }
661661 }
662662 return *this ;
663663}
0 commit comments