summaryrefslogtreecommitdiffstats
path: root/src/crush/CrushLocation.cc
diff options
context:
space:
mode:
authorRadoslaw Zarzynski <rzarzyns@redhat.com>2020-01-21 17:06:35 +0100
committerRadoslaw Zarzynski <rzarzyns@redhat.com>2020-01-26 16:22:24 +0100
commitd5e6db8c40607d1cf8aa0eed994ed46c82121d7f (patch)
tree23291f69a2a8f2946839010bdfeb4798b459c98f /src/crush/CrushLocation.cc
parenttest/bl: switch copy{_in} users to bufferlist::iterator. (diff)
downloadceph-d5e6db8c40607d1cf8aa0eed994ed46c82121d7f.tar.xz
ceph-d5e6db8c40607d1cf8aa0eed994ed46c82121d7f.zip
*: switch trivial users of bufferlist::copy{_in} to iterators.
This commits switches the most straightforward occurrences of: * ceph::bufferlist::copy(off, len, dst) and * ceph::bufferlist::copy_in(off, len, src) to use iterators. After extending `bufferlist::begin()` with the `offset` parameter and eradication of the `last_p` hint, these method look rudimentary. There is no huge benefit from bl.copy_in(off, len, dst) instead of: bl.begin(off).copy_in(len, dst) especially when `off` is `0`. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Diffstat (limited to 'src/crush/CrushLocation.cc')
-rw-r--r--src/crush/CrushLocation.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crush/CrushLocation.cc b/src/crush/CrushLocation.cc
index 0e5a0855cd6..af940bc9f7c 100644
--- a/src/crush/CrushLocation.cc
+++ b/src/crush/CrushLocation.cc
@@ -89,7 +89,7 @@ int CrushLocation::update_from_hook()
return ret;
std::string out;
- bl.copy(0, bl.length(), out);
+ bl.begin().copy(bl.length(), out);
out.erase(out.find_last_not_of(" \n\r\t")+1);
return _parse(out);
}