mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 15:22:31 +01:00
Update wikipage Removing object while iterating on a LIST. (Signed-off-by:tioui).
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2003 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[[Property:uuid|78393BBA-9B1E-4523-9881-3D83CEB6A952]]
|
||||
[[Property:weight|0]]
|
||||
[[Property:title|Iterate on a LIST and removing object]]
|
||||
[[Property:title|Removing object while iterating on a LIST]]
|
||||
If you already have the object that you want to remove from the <code>LIST</code> you can easily use <code>prune</code> and <code>prune_all</code>. But if you want to remove objects while iterating on that <code>LIST</code>, depending on criteria on the objects contained in the <code>LIST</code>, here what you can do.
|
||||
|
||||
First of all, if you think about removing object while iterating, I do not recommend using an <code>across</code> loop. If you iterate on the list using a <code>from until loop end</code>, just remember to use the <code>LIST.forth</code> only when you do not use <code>LIST.remove</code>.
|
||||
|
||||
Reference in New Issue
Block a user