Skip to content

Commit

Permalink
Replace for loops with std::slist::iterator into equivalent for-each …
Browse files Browse the repository at this point in the history
…loop in libs/
  • Loading branch information
aledomu committed Nov 21, 2024
1 parent 22a9b49 commit 4c67991
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libs/pbd/pbd/stl_delete.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ template<class T> /*LIBPBD_API*/ void list_delete (std::list<T *> *l)
#if defined(_CPP_SLIST) || defined(_GLIBCXX_SLIST) || defined(__SGI_STL_SLIST)
template<class T> /*LIBPBD_API*/ void slist_delete (std::slist<T *> *l)
{
typename std::slist<T *>::iterator i;

for (i = l->begin(); i != l->end(); i++) {
for (T*& i : *l) {
delete (*i);
}

Expand Down

0 comments on commit 4c67991

Please sign in to comment.