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

Delta Between Two Patch Sets: compiled/IntMap.h

Issue 29572731: Issue 5141 - Generalize Map class to allow non-strings as keys (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Introduced key_type_cref Created Dec. 4, 2017, 1:43 p.m.
Right Patch Set: Addressed remaining nits Created Dec. 4, 2017, 6:28 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | compiled/Map.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return key; 68 return key;
69 } 69 }
70 }; 70 };
71 71
72 template<typename Value> 72 template<typename Value>
73 struct Uint32MapEntry : Uint32SetEntry 73 struct Uint32MapEntry : Uint32SetEntry
74 { 74 {
75 typedef Uint32SetEntry super; 75 typedef Uint32SetEntry super;
76 typedef Value value_type; 76 typedef Value value_type;
77 77
78 Value second; 78 value_type second;
sergei 2017/12/04 14:26:09 Merely for the consistency the type could be value
79 79
80 Uint32MapEntry(key_type_cref key = KEY_INVALID, value_type value = value_typ e()) 80 Uint32MapEntry(key_type_cref key = KEY_INVALID, value_type value = value_typ e())
81 : Uint32SetEntry(key), second(value) 81 : Uint32SetEntry(key), second(value)
82 { 82 {
83 } 83 }
84 84
85 void erase() 85 void erase()
86 { 86 {
87 super::erase(); 87 super::erase();
88 second = value_type(); 88 second = value_type();
89 } 89 }
90 }; 90 };
91 } 91 }
92 92
93 using Uint32Set = Set<Uint32Map_internal::Uint32SetEntry>; 93 using Uint32Set = Set<Uint32Map_internal::Uint32SetEntry>;
94 94
95 template<typename Value> 95 template<typename Value>
96 using Uint32Map = Map<Uint32Map_internal::Uint32MapEntry<Value>>; 96 using Uint32Map = Map<Uint32Map_internal::Uint32MapEntry<Value>>;
LEFTRIGHT
« no previous file | compiled/Map.h » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld