diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-10-24 00:49:27 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-24 14:45:19 +0200 |
commit | 86192438d16ec160d6b59d08735e770ee05ac113 (patch) | |
tree | 25dbb9dde6631d49b0ea8483c8f3018def3ddd0d /testtools | |
parent | 6f50961e69406a17d6ec998956a6b33208b1001b (diff) |
Simplify containers iterations in test..tools
Use range-based loop or replace with STL functions.
Change-Id: If8fac9236a4696c8e56c0e81c60c429782581b96
Reviewed-on: https://gerrit.libreoffice.org/62262
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'testtools')
-rw-r--r-- | testtools/source/performance/ubtest.cxx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx index 9b342d657d5a..cc17f097d1b8 100644 --- a/testtools/source/performance/ubtest.cxx +++ b/testtools/source/performance/ubtest.cxx @@ -1146,18 +1146,16 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs ) sal_Int32 nPos = 60; out( "[direct in process]", stream, nPos ); - t_TimingSheetMap::const_iterator iSheets( aSheets.begin() ); - for ( ; iSheets != aSheets.end(); ++iSheets ) + for ( const auto& rSheet : aSheets ) { nPos += 40; out( "[", stream, nPos ); - out( (*iSheets).first.c_str(), stream ); + out( rSheet.first.c_str(), stream ); out( "]", stream ); } - for ( t_TimeEntryMap::const_iterator iTopics( aDirect._entries.begin() ); - iTopics != aDirect._entries.end(); ++iTopics ) + for ( const auto& rTopics : aDirect._entries ) { - const std::string & rTopic = (*iTopics).first; + const std::string & rTopic = rTopics.first; out( "\n", stream ); out( rTopic.c_str(), stream ); @@ -1166,7 +1164,7 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs ) sal_Int32 nPos = 60; - double secs = (*iTopics).second.secPerCall(); + double secs = rTopics.second.secPerCall(); if (secs > 0.0) { out( secs * 1000, stream, nPos ); @@ -1177,11 +1175,10 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs ) out( "NA", stream, nPos ); } - iSheets = aSheets.begin(); - for ( ; iSheets != aSheets.end(); ++iSheets ) + for ( const auto& rSheet : aSheets ) { - const t_TimeEntryMap::const_iterator iFind( (*iSheets).second._entries.find( rTopic ) ); - OSL_ENSURE( iFind != (*iSheets).second._entries.end(), "####" ); + const t_TimeEntryMap::const_iterator iFind( rSheet.second._entries.find( rTopic ) ); + OSL_ENSURE( iFind != rSheet.second._entries.end(), "####" ); nPos += 40; @@ -1192,7 +1189,7 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs ) out( "ms", stream ); out( " (", stream ); - double ratio = (*iFind).second.ratio( (*iTopics).second ); + double ratio = (*iFind).second.ratio( rTopics.second ); if (ratio != 0.0) { out( ratio, stream ); |