@@ -19,8 +19,8 @@ class PageUsage;
19
19
20
20
class QList {
21
21
public:
22
- enum Where { TAIL, HEAD };
23
- enum COMPR_METHOD { LZF = 0 , LZ4 = 1 };
22
+ enum Where : uint8_t { TAIL, HEAD };
23
+ enum COMPR_METHOD : uint8_t { LZF = 0 , LZ4 = 1 };
24
24
25
25
/* Node is a 40 byte struct describing a listpack for a quicklist.
26
26
* We use bit fields keep the Node at 40 bytes.
@@ -33,9 +33,9 @@ class QList {
33
33
* extra: 9 bits, free for future use; pads out the remainder of 32 bits
34
34
* */
35
35
36
- typedef struct Node {
37
- struct Node * prev;
38
- struct Node * next;
36
+ struct Node {
37
+ Node* prev;
38
+ Node* next;
39
39
unsigned char * entry;
40
40
size_t sz; /* entry size in bytes */
41
41
unsigned int count : 16 ; /* count of items in listpack */
@@ -45,7 +45,7 @@ class QList {
45
45
unsigned int attempted_compress : 1 ; /* node can't compress; too small */
46
46
unsigned int dont_compress : 1 ; /* prevent compression of entry that will be used later */
47
47
unsigned int extra : 25 ; /* more bits to steal for future usage */
48
- } Node ;
48
+ };
49
49
50
50
// Provides wrapper around the references to the listpack entries.
51
51
class Entry {
@@ -103,7 +103,7 @@ class QList {
103
103
};
104
104
105
105
using IterateFunc = absl::FunctionRef<bool (Entry)>;
106
- enum InsertOpt { BEFORE, AFTER };
106
+ enum InsertOpt : uint8_t { BEFORE, AFTER };
107
107
108
108
/* *
109
109
* fill: The number of entries allowed per internal list node can be specified
@@ -138,18 +138,18 @@ class QList {
138
138
*/
139
139
explicit QList (int fill = -2 , int compress = 0 );
140
140
141
- QList (QList&&);
141
+ QList (QList&&) noexcept ;
142
142
QList (const QList&) = delete ;
143
143
~QList ();
144
144
145
145
QList& operator =(const QList&) = delete ;
146
- QList& operator =(QList&&);
146
+ QList& operator =(QList&&) noexcept ;
147
147
148
148
size_t Size () const {
149
149
return count_;
150
150
}
151
151
152
- void Clear ();
152
+ void Clear () noexcept ;
153
153
154
154
void Push (std::string_view value, Where where);
155
155
@@ -194,7 +194,7 @@ class QList {
194
194
195
195
// Returns true if elements were deleted, false if list has not changed.
196
196
// Negative start index is allowed.
197
- bool Erase (const long start, unsigned count);
197
+ bool Erase (long start, unsigned count);
198
198
199
199
// Needed by tests and the rdb code.
200
200
const Node* Head () const {
@@ -246,9 +246,6 @@ class QList {
246
246
return head_ ? head_->prev : nullptr ;
247
247
}
248
248
249
- void OnPreUpdate (Node* node);
250
- void OnPostUpdate (Node* node);
251
-
252
249
// Returns newly created plain node.
253
250
Node* InsertPlainNode (Node* old_node, std::string_view, InsertOpt insert_opt);
254
251
void InsertNode (Node* old_node, Node* new_node, InsertOpt insert_opt);
0 commit comments