Skip to content
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

Merged
merged 1 commit into from Dec 27, 2016
Merged

osd: cleanup: use string & to avoid unnecessary copy #12336

merged 1 commit into from Dec 27, 2016

Conversation

wycbox
Copy link

@wycbox wycbox commented Dec 6, 2016

Signed-off-by: Yunchuan Wen yunchuan.wen@kylin-cloud.com

@liewegas liewegas changed the title cleanup: use string & to avoid unnecessary copy osd: cleanup: use string & to avoid unnecessary copy Dec 6, 2016
@liewegas liewegas added this to the kraken milestone Dec 6, 2016
@liewegas liewegas removed this from the kraken milestone Dec 7, 2016
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() ?
Copy link
Contributor

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.

Copy link
Author

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() ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/emtpy/empty/

Copy link
Contributor

@tchaikov tchaikov left a 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

http://gitbuilder.sepia.ceph.com/gitbuilder-ceph-deb-trusty-amd64-notcmalloc/log.cgi?log=447cbf246668697bcedd82bc174a54491c303402

Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
@wycbox
Copy link
Author

wycbox commented Dec 10, 2016

s/emtpy/empty/

already updated....

@wycbox
Copy link
Author

wycbox commented Dec 16, 2016

@tchaikov ping

@liewegas liewegas merged commit 075325c into ceph:master Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants