mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-05 17:52:29 +00:00
replace for_each with range loops
No advantage over the latter, which is simpler. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
committed by
Jari Sundell
parent
8b663dd169
commit
84c0d516ef
+13
-18
@@ -6,21 +6,6 @@
|
||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||
#include <torrent/utils/log.h>
|
||||
|
||||
static void
|
||||
dump_failure_log(const failure_type& failure) {
|
||||
if (failure.log->empty())
|
||||
return;
|
||||
|
||||
std::cout << std::endl << failure.name << std::endl;
|
||||
|
||||
// Doesn't print dump messages as log_buffer drops them.
|
||||
std::for_each(failure.log->begin(), failure.log->end(), [](const torrent::log_entry& entry) {
|
||||
std::cout << entry.timestamp << ' ' << entry.message << '\n';
|
||||
});
|
||||
|
||||
std::cout << std::flush;
|
||||
}
|
||||
|
||||
static void
|
||||
dump_failures(const failure_list_type& failures) {
|
||||
if (failures.empty())
|
||||
@@ -31,9 +16,19 @@ dump_failures(const failure_list_type& failures) {
|
||||
<< "Failed Test Logs:" << std::endl
|
||||
<< "=================" << std::endl;
|
||||
|
||||
std::for_each(failures.begin(), failures.end(), [](const failure_type& failure) {
|
||||
dump_failure_log(failure);
|
||||
});
|
||||
for (const auto& failure : failures) {
|
||||
if (failure.log->empty())
|
||||
return;
|
||||
|
||||
std::cout << '\n'
|
||||
<< failure.name << '\n';
|
||||
|
||||
// Doesn't print dump messages as log_buffer drops them.
|
||||
for (const auto& entry : *failure.log)
|
||||
std::cout << entry.timestamp << ' ' << entry.message << '\n';
|
||||
|
||||
std::cout << std::flush;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user