diff options
author | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2020-01-21 17:06:35 +0100 |
---|---|---|
committer | Radoslaw Zarzynski <rzarzyns@redhat.com> | 2020-01-26 16:22:24 +0100 |
commit | d5e6db8c40607d1cf8aa0eed994ed46c82121d7f (patch) | |
tree | 23291f69a2a8f2946839010bdfeb4798b459c98f /src/test/perf_local.cc | |
parent | test/bl: switch copy{_in} users to bufferlist::iterator. (diff) | |
download | ceph-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/test/perf_local.cc')
-rw-r--r-- | src/test/perf_local.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/perf_local.cc b/src/test/perf_local.cc index f386a6875b4..9df3b90cf4a 100644 --- a/src/test/perf_local.cc +++ b/src/test/perf_local.cc @@ -246,7 +246,7 @@ double buffer_copy() char copy[10]; uint64_t start = Cycles::rdtsc(); for (int i = 0; i < count; i++) { - b.copy(2, 6, copy); + b.cbegin(2).copy(6, copy); } uint64_t stop = Cycles::rdtsc(); return Cycles::to_seconds(stop - start)/count; |