diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-02 09:41:30 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-02 09:41:30 +0000 |
| commit | 169dff19d4da8d76e69b8e896aa25b0013639c03 (patch) | |
| tree | a0c070fa95188b5cde708ac285e6a2db9df4a83f /src/display/canvas-temporary-item-list.cpp | |
| parent | Avoid creating a new document before opening an old document. (diff) | |
| download | inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.tar.gz inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.zip | |
modernize loops
Diffstat (limited to 'src/display/canvas-temporary-item-list.cpp')
| -rw-r--r-- | src/display/canvas-temporary-item-list.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/display/canvas-temporary-item-list.cpp b/src/display/canvas-temporary-item-list.cpp index ad112cdbb..caa960969 100644 --- a/src/display/canvas-temporary-item-list.cpp +++ b/src/display/canvas-temporary-item-list.cpp @@ -26,8 +26,7 @@ TemporaryItemList::TemporaryItemList(SPDesktop *desktop) TemporaryItemList::~TemporaryItemList() { // delete all items in list so the timeouts are removed - for ( std::list<TemporaryItem*>::iterator it = itemlist.begin(); it != itemlist.end(); ++it ) { - TemporaryItem * tempitem = *it; + for (auto tempitem : itemlist) { delete tempitem; } itemlist.clear(); @@ -49,8 +48,8 @@ TemporaryItemList::delete_item( TemporaryItem * tempitem ) { // check if the item is in the list, if so, delete it. (in other words, don't wait for the item to delete itself) bool in_list = false; - for ( std::list<TemporaryItem*>::iterator it = itemlist.begin(); it != itemlist.end(); ++it ) { - if ( *it == tempitem ) { + for (auto & it : itemlist) { + if ( it == tempitem ) { in_list = true; break; } |
