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

Side by Side Diff: compiled/IntMap.h

Issue 29637575: Noissue - fix Uint32SetEntry::erase what could lead to a data loss (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git
Patch Set: Created Dec. 13, 2017, 11:54 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return first == KEY_INVALID; 56 return first == KEY_INVALID;
57 } 57 }
58 58
59 bool is_deleted() const 59 bool is_deleted() const
60 { 60 {
61 return first == KEY_DELETED; 61 return first == KEY_DELETED;
62 } 62 }
63 63
64 void erase() 64 void erase()
65 { 65 {
66 first = KEY_INVALID; 66 first = KEY_DELETED;
67 } 67 }
68 68
69 static size_type hash(key_type_cref key) 69 static size_type hash(key_type_cref key)
70 { 70 {
71 return key; 71 return key;
72 } 72 }
73 }; 73 };
74 74
75 template<typename Value> 75 template<typename Value>
76 struct Uint32MapEntry : Uint32SetEntry 76 struct Uint32MapEntry : Uint32SetEntry
(...skipping 15 matching lines...) Expand all
92 } 92 }
93 }; 93 };
94 } 94 }
95 95
96 using Uint32Set = Set<Uint32Map_internal::Uint32SetEntry>; 96 using Uint32Set = Set<Uint32Map_internal::Uint32SetEntry>;
97 97
98 template<typename Value> 98 template<typename Value>
99 using Uint32Map = Map<Uint32Map_internal::Uint32MapEntry<Value>>; 99 using Uint32Map = Map<Uint32Map_internal::Uint32MapEntry<Value>>;
100 100
101 ABP_NS_END 101 ABP_NS_END
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld