Merge pull request #411 from apache/5.0.1_patch

5.0.1 patch
diff --git a/kll/include/kll_helper_impl.hpp b/kll/include/kll_helper_impl.hpp
index e763c57..bb92bdc 100644
--- a/kll/include/kll_helper_impl.hpp
+++ b/kll/include/kll_helper_impl.hpp
@@ -230,7 +230,8 @@
       // move level over as is
       // make sure we are not moving data upwards
       if (raw_beg < out_levels[current_level]) throw std::logic_error("wrong move");
-      std::move(items + raw_beg, items + raw_lim, items + out_levels[current_level]);
+      if (raw_beg != out_levels[current_level])
+        std::move(items + raw_beg, items + raw_lim, items + out_levels[current_level]);
       out_levels[current_level + 1] = out_levels[current_level] + raw_pop;
     } else {
       // The sketch is too full AND this level is too full, so we compact it
@@ -243,7 +244,8 @@
       const auto half_adj_pop = adj_pop / 2;
 
       if (odd_pop) { // move one guy over
-        items[out_levels[current_level]] = std::move(items[raw_beg]);
+        if (out_levels[current_level] != raw_beg)
+          items[out_levels[current_level]] = std::move(items[raw_beg]);
         out_levels[current_level + 1] = out_levels[current_level] + 1;
       } else { // even number of items
         out_levels[current_level + 1] = out_levels[current_level];
diff --git a/sampling/include/ebpps_sample_impl.hpp b/sampling/include/ebpps_sample_impl.hpp
index afa4dca..f379841 100644
--- a/sampling/include/ebpps_sample_impl.hpp
+++ b/sampling/include/ebpps_sample_impl.hpp
@@ -178,7 +178,11 @@
   uint32_t idx = 0;
   for (const T& item : data_)
     oss << "\t" << idx++ << ":\t" << item << std::endl;
-  oss << "   partial: " << (bool(partial_item_) ? (*partial_item_) : "NULL") << std::endl;
+  oss << "   partial: ";
+  if (bool(partial_item_))
+    oss << (*partial_item_) << std::endl;
+  else
+    oss << "NULL" << std::endl;
 
   return oss.str();
 }
diff --git a/version.cfg.in b/version.cfg.in
index 0062ac9..6b244dc 100644
--- a/version.cfg.in
+++ b/version.cfg.in
@@ -1 +1 @@
-5.0.0
+5.0.1