Bug 190796 - Deque's contains() and findIf() should be const
Summary: Deque's contains() and findIf() should be const
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-22 09:39 PDT by Chris Dumez
Modified: 2018-10-22 14:06 PDT (History)
12 users (show)

See Also:


Attachments
Patch (5.61 KB, patch)
2018-10-22 10:10 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-10-22 09:39:02 PDT
Deque's contains() and findIf() should be const as they do not modify the container.
Comment 1 Chris Dumez 2018-10-22 10:10:54 PDT
Created attachment 352895 [details]
Patch
Comment 2 Antti Koivisto 2018-10-22 11:31:41 PDT
Comment on attachment 352895 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352895&action=review

> Source/WTF/wtf/Deque.h:407
> +    return std::find_if(begin(), end(), predicate);

Considering how few clients this stuff has, maybe they could just do this themselves.
Comment 3 Chris Dumez 2018-10-22 11:40:03 PDT
Comment on attachment 352895 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352895&action=review

>> Source/WTF/wtf/Deque.h:407
>> +    return std::find_if(begin(), end(), predicate);
> 
> Considering how few clients this stuff has, maybe they could just do this themselves.

I considered that but I personally do not like the std::algorithm functions as they are too verbose. I like that our container types have their own less verbose convenience methods.
Comment 4 WebKit Commit Bot 2018-10-22 14:05:09 PDT
Comment on attachment 352895 [details]
Patch

Clearing flags on attachment: 352895

Committed r237329: <https://trac.webkit.org/changeset/237329>
Comment 5 WebKit Commit Bot 2018-10-22 14:05:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-10-22 14:06:33 PDT
<rdar://problem/45465502>