diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-10 19:07:30 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-17 14:08:33 +0200 |
commit | edcdfe5477559ca6c62897f0cad47d4d6149d77a (patch) | |
tree | bf97f0a716e760a3de4d95604483d26d943bd69f /sax/source/expatwrap/xml2utf.cxx | |
parent | 5ad254ed246cf8d11b55e50ed0ccba5736d0cdbb (diff) |
Simplify Sequence iterations in postprocess..sax
Use range-based loops, STL and comphelper functions
Change-Id: If738d8f4e792c4686870183b0c0fdfbb61fd3351
Reviewed-on: https://gerrit.libreoffice.org/77245
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'sax/source/expatwrap/xml2utf.cxx')
-rw-r--r-- | sax/source/expatwrap/xml2utf.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx index c71f0bf2a993..103ef46344cb 100644 --- a/sax/source/expatwrap/xml2utf.cxx +++ b/sax/source/expatwrap/xml2utf.cxx @@ -187,15 +187,8 @@ bool XMLFile2UTFConverter::isEncodingRecognizable( const Sequence< sal_Int8 > &s if( bCheckIfFirstClosingBracketExsists ) { - for( sal_Int32 i = 0; i < seq.getLength() ; i ++ ) - { - // whole <?xml tag is valid - if( '>' == pSource[ i ] ) - { - return true; - } - } - return false; + // whole <?xml tag is valid + return std::find(seq.begin(), seq.end(), '>') != seq.end(); } // No <? tag in front, no need for a bigger buffer |