hashSet.remove(hashSet.random()) doesn't build
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Oct 2018 16:27:23 +0000 (16:27 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Oct 2018 16:27:23 +0000 (16:27 +0000)
commit2d8f3a04d98e6edccc5883fac4f3b672d081fb00
tree69418bc8685b48d5b293e9b48485ddd6f8a86ce1
parenta3257c0a491847684af8f5ccefc52740ddd12b0f
hashSet.remove(hashSet.random()) doesn't build
https://bugs.webkit.org/show_bug.cgi?id=190953

Reviewed by Chris Dumez.

Source/WTF:

* wtf/HashSet.h:

Remove non-const random(). HashSet only returns const iterators (it is immutable via iterator).

* wtf/HashTable.h:
(WTF::HashTable::random const):

Invoke const_iterator() by using static_cast<> instead of trying to do it directly.

Tools:

* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/HashSet.h
Source/WTF/wtf/HashTable.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp