From a784ac2daf55f9e620d7c8da1b880ee539d9218a Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 20 Dec 2017 05:51:54 +0200 Subject: loplugin:unusedindex Change-Id: I80c0a8dbfda14e54fcfaf33a241c83bad8495db1 Reviewed-on: https://gerrit.libreoffice.org/46833 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/comphelper/basicio.hxx | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'include/comphelper') diff --git a/include/comphelper/basicio.hxx b/include/comphelper/basicio.hxx index 3dd8aea727ae..de444e0c12a1 100644 --- a/include/comphelper/basicio.hxx +++ b/include/comphelper/basicio.hxx @@ -63,28 +63,18 @@ COMPHELPER_DLLPUBLIC const css::uno::Reference& op template const css::uno::Reference& operator >> (const css::uno::Reference& _rxInStream, css::uno::Sequence& _rSeq) { - sal_Int32 nLen = _rxInStream->readLong(); - _rSeq.realloc(nLen); - if (nLen) - { - ELEMENT* pElement = _rSeq.getArray(); - for (sal_Int32 i=0; i> *pElement; - } + _rSeq.realloc(_rxInStream->readLong()); + for (ELEMENT& rElement : _rSeq) + _rxInStream >> rElement; return _rxInStream; } template const css::uno::Reference& operator << (const css::uno::Reference& _rxOutStream, const css::uno::Sequence& _rSeq) { - sal_Int32 nLen = _rSeq.getLength(); - _rxOutStream->writeLong(nLen); - if (nLen) - { - const ELEMENT* pElement = _rSeq.getConstArray(); - for (sal_Int32 i = 0; i < nLen; ++i, ++pElement) - _rxOutStream << *pElement; - } + _rxOutStream->writeLong(_rSeq.getLength()); + for (const ELEMENT& rElement : _rSeq) + _rxOutStream << rElement; return _rxOutStream; } -- cgit