Bug 23974 - Deque::Remove would be a useful method.
Summary: Deque::Remove would be a useful method.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: David Levin
Depends on:
Blocks: 23976
  Show dependency treegraph
Reported: 2009-02-16 10:52 PST by David Levin
Modified: 2009-02-18 16:30 PST (History)
0 users

See Also:

Patch for bug. (5.15 KB, patch)
2009-02-16 10:59 PST, David Levin
no flags Details | Formatted Diff | Diff
Proposed fix. (5.15 KB, patch)
2009-02-16 14:26 PST, David Levin
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2009-02-16 10:52:23 PST
This is simply a way to remove an item from within a deque.

Although it shouldn't be the primary means of removing items from a queue, it is useful to have.  (This will be used in support of a feature addition to a message queue.)

Also, the implementation of copy for deque iterators is missing an implemention of WTF::DequeIteratorBase<T>::operator=.
Comment 1 David Levin 2009-02-16 10:59:32 PST
Created attachment 27701 [details]
Patch for bug.
Comment 2 David Levin 2009-02-16 14:26:22 PST
Created attachment 27709 [details]
Proposed fix.

Remove one extra blank line from last patch.
Comment 3 Alexey Proskuryakov 2009-02-18 11:06:48 PST
Comment on attachment 27709 [details]
Proposed fix.

> +        Add Deque::remove and Deque*Iterator::copy.

As discussed on IRC, it's quite unclear why DequeIteratorBase<T>::operator= was added, an explanation in ChangeLog would help a lot. Concrete iterators assignment operators were calling Base::assign(), which in turn called this unimplemented operator=. We could only get away with that because all this code was unused.

Other containers' remove() methods have an early return for end(), so Deque::remove should have it, too.

r=me, with this bug fixed, and a better ChangeLog.
Comment 4 David Levin 2009-02-18 16:30:03 PST
Committed as r41068.