From 3c094c739ba38f43edf9698ac37dd9eee62080b1 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Wed, 8 Jul 2020 23:59:15 -0400 Subject: [PATCH] Simplify code a bit. Should be equivalent, unless backs is empty! --- src/BufferParams.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 4ed8b4ea9a..4a70ed884d 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2653,12 +2653,10 @@ FormatList const & BufferParams::exportableFormats(bool only_viewable) const excludes.insert("xetex"); } - FormatList result = - theConverters().getReachable(backs[0], only_viewable, true, excludes); - vector::const_iterator it = backs.begin() + 1; - for (; it != backs.end(); ++it) { - FormatList r = theConverters().getReachable(*it, only_viewable, - false, excludes); + FormatList result; + for (auto const & b : backs) { + FormatList r = + theConverters().getReachable(b, only_viewable, false, excludes); result.insert(result.end(), r.begin(), r.end()); } sort(result.begin(), result.end(), Format::formatSorter); -- 2.39.5