New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osd: cleanup: use string & to avoid unnecessary copy #12336
Conversation
string key = req->get_object_locator().key; | ||
if (key.length() == 0) | ||
key = req->get_oid().name; | ||
const string &key = req->get_object_locator().key.length() ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, might want to use req->get_object_locator().key.empty()
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right.
string key = req->get_object_locator().key; | ||
if (key.length() == 0) | ||
key = req->get_oid().name; | ||
const string &key = req->get_object_locator().key.emtpy() ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/emtpy/empty/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.2-2400-g447cbf2/src/osd/PG.cc: In member function ‘bool PG::op_has_sufficient_caps(OpRequestRef&)’:
error: /srv/autobuild-ceph/gitbuilder.git/build/out~/ceph-11.0.2-2400-g447cbf2/src/osd/PG.cc:1871:53: ‘const string’ has no member named ‘emtpy’
const string &key = req->get_object_locator().key.emtpy() ?
^
[ 62%] Building CXX object CMakeFiles/rocksdblib.dir/util/options.cc.o
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
already updated.... |
@tchaikov ping |
Signed-off-by: Yunchuan Wen yunchuan.wen@kylin-cloud.com