Skip to content

Commit 7934d4c

Browse files
authored
Merge pull request #411 from apache/5.0.1_patch
5.0.1 patch
2 parents b39e41b + 247b4c4 commit 7934d4c

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

kll/include/kll_helper_impl.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ kll_helper::compress_result kll_helper::general_compress(uint16_t k, uint8_t m,
230230
// move level over as is
231231
// make sure we are not moving data upwards
232232
if (raw_beg < out_levels[current_level]) throw std::logic_error("wrong move");
233-
std::move(items + raw_beg, items + raw_lim, items + out_levels[current_level]);
233+
if (raw_beg != out_levels[current_level])
234+
std::move(items + raw_beg, items + raw_lim, items + out_levels[current_level]);
234235
out_levels[current_level + 1] = out_levels[current_level] + raw_pop;
235236
} else {
236237
// The sketch is too full AND this level is too full, so we compact it
@@ -243,7 +244,8 @@ kll_helper::compress_result kll_helper::general_compress(uint16_t k, uint8_t m,
243244
const auto half_adj_pop = adj_pop / 2;
244245

245246
if (odd_pop) { // move one guy over
246-
items[out_levels[current_level]] = std::move(items[raw_beg]);
247+
if (out_levels[current_level] != raw_beg)
248+
items[out_levels[current_level]] = std::move(items[raw_beg]);
247249
out_levels[current_level + 1] = out_levels[current_level] + 1;
248250
} else { // even number of items
249251
out_levels[current_level + 1] = out_levels[current_level];

sampling/include/ebpps_sample_impl.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ string<A> ebpps_sample<T ,A>::to_string() const {
178178
uint32_t idx = 0;
179179
for (const T& item : data_)
180180
oss << "\t" << idx++ << ":\t" << item << std::endl;
181-
oss << " partial: " << (bool(partial_item_) ? (*partial_item_) : "NULL") << std::endl;
181+
oss << " partial: ";
182+
if (bool(partial_item_))
183+
oss << (*partial_item_) << std::endl;
184+
else
185+
oss << "NULL" << std::endl;
182186

183187
return oss.str();
184188
}

version.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
5.0.1

0 commit comments

Comments
 (0)