Method: Packet_List#remove_item
- Defined in:
- lib/Packet_List.rb
#remove_item(item) ⇒ Object
Remove the given Packet_Item from the list. This is slow, because the item has to be searched with a linear search. To remove all items use #clear.
117 118 119 120 121 122 123 124 |
# File 'lib/Packet_List.rb', line 117 def remove_item(item) i = 0 @items.delete item fox_item = item.fox_item i += 1 while i < numItems && fox_item != getItem(i) removeItem(i) if i < numItems item end |