summaryrefslogtreecommitdiff
path: root/binaryurp/source/writer.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-22 13:49:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-22 16:35:20 +0200
commitc18e2ea2a52fc171c50fcb22d431e94c6aececc5 (patch)
treea63721b18626947e5278a51feb7fd64604e80eee /binaryurp/source/writer.cxx
parent7cf4bcef41448218f76fa1e974f541e13dc03023 (diff)
New loplugin:data
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'binaryurp/source/writer.cxx')
-rw-r--r--binaryurp/source/writer.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
index 14b87449926a..585f375d7a58 100644
--- a/binaryurp/source/writer.cxx
+++ b/binaryurp/source/writer.cxx
@@ -415,7 +415,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
Marshal::write32(&header, static_cast< sal_uInt32 >(buffer.size()));
Marshal::write32(&header, 1);
assert(!buffer.empty());
- unsigned char const * p = &buffer[0];
+ unsigned char const * p = buffer.data();
std::vector< unsigned char >::size_type n = buffer.size();
assert(header.size() <= SAL_MAX_INT32);
/*static_*/assert(SAL_MAX_INT32 <= std::numeric_limits<std::size_t>::max());
@@ -425,7 +425,7 @@ void Writer::sendMessage(std::vector< unsigned char > const & buffer) {
}
css::uno::Sequence<sal_Int8> s(header.size() + k);
assert(!header.empty());
- std::memcpy(s.getArray(), &header[0], header.size());
+ std::memcpy(s.getArray(), header.data(), header.size());
for (;;) {
std::memcpy(s.getArray() + s.getLength() - k, p, k);
try {