mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 21:52:30 +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
@@ -45,7 +45,8 @@ namespace display {
|
||||
|
||||
void
|
||||
TextElementList::clear() {
|
||||
std::for_each(begin(), end(), [](TextElement* t) { delete t; });
|
||||
for (auto t : *this)
|
||||
delete t;
|
||||
base_type::clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ WindowText::WindowText(rpc::target_type target, extent_type margin) :
|
||||
|
||||
void
|
||||
WindowText::clear() {
|
||||
std::for_each(begin(), end(), [](TextElement* text) { delete text; });
|
||||
for (auto t : *this)
|
||||
delete t;
|
||||
base_type::clear();
|
||||
|
||||
delete m_errorHandler;
|
||||
|
||||
Reference in New Issue
Block a user