Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29572731: Issue 5141 - Generalize Map class to allow non-strings as keys (Closed)

Created:
Oct. 10, 2017, 2:18 p.m. by Wladimir Palant
Modified:
Dec. 20, 2017, 9:21 a.m.
Reviewers:
sergei, hub
CC:
Felix Dahlke
Base URL:
https://hg.adblockplus.org/adblockpluscore
Visibility:
Public.

Description

This makes non-string key types in our hash tables possible, which is required if we want an int-keyed hash table for Rabin-Karp algorithm.

Patch Set 1 : #

Total comments: 5

Patch Set 2 : Exposed superclass constructors properly #

Patch Set 3 : Use constructor inheritance #

Total comments: 29

Patch Set 4 : Addressed review comments #

Patch Set 5 : Removed redundant template parameter for Map class as well #

Patch Set 6 : Fixed key initialization issue #

Total comments: 9

Patch Set 7 : Introduced key_type_cref #

Total comments: 3

Patch Set 8 : Addressed remaining nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -398 lines) Patch
A compiled/IntMap.h View 1 2 3 4 5 6 7 1 chunk +96 lines, -0 lines 0 comments Download
M compiled/Map.h View 1 2 3 4 5 6 6 chunks +56 lines, -99 lines 0 comments Download
M compiled/StringMap.h View 1 2 3 4 5 6 7 1 chunk +38 lines, -299 lines 0 comments Download

Messages

Total messages: 17
Wladimir Palant
This makes non-string key types in our hash tables possible, which is required if we ...
Oct. 10, 2017, 2:33 p.m. (2017-10-10 14:33:59 UTC) #1
Wladimir Palant
I realized that only the default constructor without parameters was exposed on StringSet, this issue ...
Oct. 10, 2017, 6:25 p.m. (2017-10-10 18:25:38 UTC) #2
Wladimir Palant
This can be made a bit nicer by using constructor inheritance introduced in C++11.
Oct. 10, 2017, 6:31 p.m. (2017-10-10 18:31:34 UTC) #3
hub
https://codereview.adblockplus.org/29572731/diff/29572868/compiled/IntMap.h File compiled/IntMap.h (right): https://codereview.adblockplus.org/29572731/diff/29572868/compiled/IntMap.h#newcode33 compiled/IntMap.h:33: static const int KEY_DELETED = -2; Do these two ...
Oct. 10, 2017, 8:37 p.m. (2017-10-10 20:37:53 UTC) #4
sergei
Merely code style comments, it seems there are not defects, though I have not tried ...
Oct. 11, 2017, 10:03 a.m. (2017-10-11 10:03:22 UTC) #5
sergei
https://codereview.adblockplus.org/29572731/diff/29572868/compiled/IntMap.h File compiled/IntMap.h (right): https://codereview.adblockplus.org/29572731/diff/29572868/compiled/IntMap.h#newcode74 compiled/IntMap.h:74: struct IntMapEntry : IntSetEntry On 2017/10/11 10:03:21, sergei wrote: ...
Oct. 11, 2017, 10:05 a.m. (2017-10-11 10:05:11 UTC) #6
Wladimir Palant
https://codereview.adblockplus.org/29572731/diff/29572868/compiled/IntMap.h File compiled/IntMap.h (right): https://codereview.adblockplus.org/29572731/diff/29572868/compiled/IntMap.h#newcode28 compiled/IntMap.h:28: typedef int key_type; On 2017/10/11 10:03:21, sergei wrote: > ...
Oct. 11, 2017, 6:28 p.m. (2017-10-11 18:28:32 UTC) #7
hub
LGTM
Oct. 11, 2017, 6:51 p.m. (2017-10-11 18:51:12 UTC) #8
Wladimir Palant
Now that I have actual code using this, I noticed that the keys weren't initialized ...
Oct. 17, 2017, 11:46 a.m. (2017-10-17 11:46:34 UTC) #9
sergei
LGTM, however I think we should pay attention to the comments in compiled/StringMap.h. https://codereview.adblockplus.org/29572731/diff/29572868/compiled/IntMap.h File ...
Oct. 17, 2017, 12:58 p.m. (2017-10-17 12:58:07 UTC) #10
hub
LGTM
Oct. 17, 2017, 1:01 p.m. (2017-10-17 13:01:08 UTC) #11
hub
https://codereview.adblockplus.org/29572731/diff/29581584/compiled/Map.h File compiled/Map.h (right): https://codereview.adblockplus.org/29572731/diff/29581584/compiled/Map.h#newcode263 compiled/Map.h:263: u"The keys used in map.find() and assign() should be ...
Nov. 21, 2017, 2:10 p.m. (2017-11-21 14:10:40 UTC) #12
Wladimir Palant
https://codereview.adblockplus.org/29572731/diff/29581584/compiled/Map.h File compiled/Map.h (right): https://codereview.adblockplus.org/29572731/diff/29581584/compiled/Map.h#newcode263 compiled/Map.h:263: u"The keys used in map.find() and assign() should be ...
Dec. 4, 2017, 1:44 p.m. (2017-12-04 13:44:15 UTC) #13
sergei
LGTM https://codereview.adblockplus.org/29572731/diff/29581584/compiled/StringMap.h File compiled/StringMap.h (right): https://codereview.adblockplus.org/29572731/diff/29581584/compiled/StringMap.h#newcode37 compiled/StringMap.h:37: first.reset(key); On 2017/12/04 13:44:15, Wladimir Palant wrote: > ...
Dec. 4, 2017, 2:26 p.m. (2017-12-04 14:26:10 UTC) #14
Wladimir Palant
https://codereview.adblockplus.org/29572731/diff/29629917/compiled/StringMap.h File compiled/StringMap.h (right): https://codereview.adblockplus.org/29572731/diff/29629917/compiled/StringMap.h#newcode35 compiled/StringMap.h:35: StringSetEntry(key_type_cref key = DependentString()) On 2017/12/04 14:26:09, sergei wrote: ...
Dec. 4, 2017, 6:28 p.m. (2017-12-04 18:28:49 UTC) #15
sergei
LGTM
Dec. 4, 2017, 7:40 p.m. (2017-12-04 19:40:50 UTC) #16
sergei
Dec. 20, 2017, 9:19 a.m. (2017-12-20 09:19:47 UTC) #17
It's already landed, could you please close it.

Powered by Google App Engine
This is Rietveld