summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-08-15 21:32:27 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-20 17:12:11 +0200
commit0787ce8814e37972a0c968f60008d4e8722b6e27 (patch)
tree9d2803ebda8813e6b3f2bc2e6f8a74953b2931c1 /shell
parentd2c9c60fefb9687adbde4be61ed66a5123a2587f (diff)
Simplify containers iterations, tdf#96099 follow-up
Use range-based loop or replace with std::any_of, std::find and std::find_if where applicable. Change-Id: I2f80788c49d56094c29b102eb96a7a7c079567c6 Reviewed-on: https://gerrit.libreoffice.org/59143 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx7
-rw-r--r--shell/source/unix/sysshell/recently_used_file_handler.cxx7
2 files changed, 4 insertions, 10 deletions
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index 802cafb6a08b..85f36ae8e28e 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -470,15 +470,12 @@ void inflate_rc_template_to_file(
{
substitutor.set_language(iso_lang_identifier(iter->first));
- auto rct_iter = rctmpl.cbegin();
- auto rct_iter_end = rctmpl.cend();
-
if (!rctmpl.empty())
start_language_section(oi, iso_lang_identifier(iter->first));
- for ( /**/ ;rct_iter != rct_iter_end; ++rct_iter)
+ for ( auto& rct : rctmpl)
{
- std::istringstream iss(*rct_iter);
+ std::istringstream iss(rct);
std::string line;
while (iss)
diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index 49c200eb47b6..0742e8b8912d 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -125,11 +125,8 @@ namespace /* private */ {
{
write_xml_start_tag(TAG_GROUPS, file, true);
- auto iter = groups_.cbegin();
- auto iter_end = groups_.cend();
-
- for ( ; iter != iter_end; ++iter)
- write_xml_tag(TAG_GROUP, (*iter), file);
+ for (auto& group : groups_)
+ write_xml_tag(TAG_GROUP, group, file);
write_xml_end_tag(TAG_GROUPS, file);
}