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

Delta Between Two Patch Sets: compiled/StringMap.h

Issue 29677755: Issue 6279 - Make HashContainer movable and optimize resizing by moving entries. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Remove unneeded ctor. Rename _assign() Created Jan. 24, 2018, 7:31 p.m.
Right Patch Set: remove more unused ctor Created Jan. 25, 2018, 3:10 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 | « compiled/Map.h ('k') | no next file » | 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 }; 86 };
87 87
88 template<typename Key, typename Value> 88 template<typename Key, typename Value>
89 struct StringMapEntry : StringSetEntry<Key> 89 struct StringMapEntry : StringSetEntry<Key>
90 { 90 {
91 typedef StringSetEntry<Key> super; 91 typedef StringSetEntry<Key> super;
92 typedef Value value_type; 92 typedef Value value_type;
93 93
94 value_type second; 94 value_type second;
95 95
96 StringMapEntry& operator=(const StringMapEntry&) = default;
97 StringMapEntry& operator=(StringMapEntry&&) = default;
98
99 StringMapEntry(typename super::key_type_cref key = Key(), 96 StringMapEntry(typename super::key_type_cref key = Key(),
100 value_type value = value_type()) 97 value_type value = value_type())
101 : super(key), second(std::move(value)) 98 : super(key), second(std::move(value))
102 { 99 {
103 } 100 }
104 101
105 void erase() 102 void erase()
106 { 103 {
107 super::erase(); 104 super::erase();
108 second = value_type(); 105 second = value_type();
109 } 106 }
110 }; 107 };
111 } 108 }
112 109
113 using StringSet = Set<StringMap_internal::StringSetEntry<DependentString>>; 110 using StringSet = Set<StringMap_internal::StringSetEntry<DependentString>>;
114 111
115 template<typename Value> 112 template<typename Value>
116 using StringMap = Map<StringMap_internal::StringMapEntry<DependentString, Value> >; 113 using StringMap = Map<StringMap_internal::StringMapEntry<DependentString, Value> >;
117 template<typename Value> 114 template<typename Value>
118 using OwnedStringMap = Map<StringMap_internal::StringMapEntry<OwnedString, Value >>; 115 using OwnedStringMap = Map<StringMap_internal::StringMapEntry<OwnedString, Value >>;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld