]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/onode-staged-tree: fix incorrect string cstr
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 22 Sep 2020 05:45:20 +0000 (13:45 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 1 Dec 2020 04:50:53 +0000 (12:50 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h

index ae61f60c0d98ab0c89b60c88ab036d83be69ee04..01caa32341c72e8725b7ade405264d8d0282b4a6 100644 (file)
@@ -240,10 +240,10 @@ inline std::ostream& operator<<(std::ostream& os, const string_key_view_t& view)
     return os << "MAX";
   } else {
     if (view.length <= 12) {
-      os << "\"" << std::string(view.p_key, 0, view.length) << "\"";
+      os << "\"" << std::string_view(view.p_key, view.length) << "\"";
     } else {
-      os << "\"" << std::string(view.p_key, 0, 4) << ".."
-         << std::string(view.p_key + view.length - 2, 0, 2)
+      os << "\"" << std::string_view(view.p_key, 4) << ".."
+         << std::string_view(view.p_key + view.length - 2, 2)
          << "/" << view.length << "B\"";
     }
     return os;