mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
common/hobject: use string::append() to avoid temp object
Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
8f2537ff30
commit
c6337b4138
@ -75,7 +75,7 @@ string hobject_t::to_str() const
|
||||
|
||||
char snap_with_hash[1000];
|
||||
char *t = snap_with_hash;
|
||||
char *end = t + sizeof(snap_with_hash);
|
||||
const char *end = t + sizeof(snap_with_hash);
|
||||
|
||||
uint64_t poolid(pool);
|
||||
t += snprintf(t, end - t, "%.*llX", 16, (long long unsigned)poolid);
|
||||
@ -90,7 +90,7 @@ string hobject_t::to_str() const
|
||||
else
|
||||
t += snprintf(t, end - t, ".%llx", (long long unsigned)snap);
|
||||
|
||||
out += string(snap_with_hash);
|
||||
out.append(snap_with_hash, t);
|
||||
|
||||
out.push_back('.');
|
||||
append_escaped(oid.name, &out);
|
||||
|
Loading…
Reference in New Issue
Block a user