OLD | NEW |
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 { | 286 { |
287 #if defined(DEBUG) | 287 #if defined(DEBUG) |
288 mInsertCounter = mMap->mInsertCounter; | 288 mInsertCounter = mMap->mInsertCounter; |
289 mHash = mMap->hash(key); | 289 mHash = mMap->hash(key); |
290 #endif | 290 #endif |
291 } | 291 } |
292 | 292 |
293 void assign(const String& key, const T& value) | 293 void assign(const String& key, const T& value) |
294 { | 294 { |
295 #if defined(DEBUG) | 295 #if defined(DEBUG) |
296 assert(mInsertCounter == mMap->mInsertCounter, | 296 assert2(mInsertCounter == mMap->mInsertCounter, |
297 u"There should be no insert operations performed between map.find() an
d assign()"_str); | 297 u"There should be no insert operations performed between map.find() an
d assign()"_str); |
298 assert(mHash == mMap->hash(key), | 298 assert2(mHash == mMap->hash(key), |
299 u"The keys used in map.find() and assign() should be identical"_str); | 299 u"The keys used in map.find() and assign() should be identical"_str); |
300 #endif | 300 #endif |
301 | 301 |
302 mMap->assign(this->mEntry, entry_type(key, value)); | 302 mMap->assign(this->mEntry, entry_type(key, value)); |
303 } | 303 } |
304 }; | 304 }; |
305 } | 305 } |
306 | 306 |
307 class StringSet | 307 class StringSet |
308 : public StringMap_internal::HashContainer<StringMap_internal::StringSetEntry> | 308 : public StringMap_internal::HashContainer<StringMap_internal::StringSetEntry> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 const_reference find(const String& key) const | 348 const_reference find(const String& key) const |
349 { | 349 { |
350 return super::find(key); | 350 return super::find(key); |
351 } | 351 } |
352 | 352 |
353 reference find(const String& key) | 353 reference find(const String& key) |
354 { | 354 { |
355 return reference(this, key, super::find_bucket(key)); | 355 return reference(this, key, super::find_bucket(key)); |
356 } | 356 } |
357 }; | 357 }; |
OLD | NEW |