Method
remove
(Object o, boolean first)
Source from the content-addressed store, hash-verified
| 183 | } |
| 184 | |
| 185 | private boolean remove(Object o, boolean first) { |
| 186 | modCount++; |
| 187 | |
| 188 | Iterator<T> it; |
| 189 | if (first) { |
| 190 | it = iterator(); |
| 191 | } else { |
| 192 | it = descendingIterator(); |
| 193 | } |
| 194 | while (it.hasNext()) { |
| 195 | T next = it.next(); |
| 196 | if (next == null) { |
| 197 | if (o == null) { |
| 198 | it.remove(); |
| 199 | return true; |
| 200 | } |
| 201 | } else if (next.equals(o)) { |
| 202 | it.remove(); |
| 203 | return true; |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | @Override |
| 211 | public boolean removeFirstOccurrence(Object o) { |
Tested by
no test coverage detected