1
1
/*
2
- * Copyright (c) 1997, 2021 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1997, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,7 @@ void Dict::doubhash() {
141
141
// ------------------------------Insert----------------------------------------
142
142
// Insert or replace a key/value pair in the given dictionary. If the
143
143
// dictionary is too full, it's size is doubled. The prior value being
144
- // replaced is returned (NULL if this is a 1st insertion of that key). If
144
+ // replaced is returned (null if this is a 1st insertion of that key). If
145
145
// an old value is found, it's swapped with the prior key-value pair on the
146
146
// list. This moves a commonly searched-for value towards the list head.
147
147
void *Dict::Insert (void * key, void * val, bool replace) {
@@ -177,7 +177,7 @@ void*Dict::Insert(void* key, void* val, bool replace) {
177
177
b->_keyvals [b->_cnt + b->_cnt ] = key;
178
178
b->_keyvals [b->_cnt + b->_cnt + 1 ] = val;
179
179
b->_cnt ++;
180
- return NULL ; // Nothing found prior
180
+ return nullptr ; // Nothing found prior
181
181
}
182
182
183
183
// ------------------------------Delete---------------------------------------
@@ -195,11 +195,11 @@ void* Dict::Delete(void* key) {
195
195
return prior;
196
196
}
197
197
}
198
- return NULL ;
198
+ return nullptr ;
199
199
}
200
200
201
201
// ------------------------------FindDict-------------------------------------
202
- // Find a key-value pair in the given dictionary. If not found, return NULL .
202
+ // Find a key-value pair in the given dictionary. If not found, return null .
203
203
// If found, move key-value pair towards head of list.
204
204
void * Dict::operator [](const void * key) const {
205
205
uint i = _hash (key) & (_size - 1 ); // Get hash key, corrected for size
@@ -209,7 +209,7 @@ void* Dict::operator [](const void* key) const {
209
209
return b->_keyvals [j + j + 1 ];
210
210
}
211
211
}
212
- return NULL ;
212
+ return nullptr ;
213
213
}
214
214
215
215
// ------------------------------print------------------------------------------
@@ -287,7 +287,7 @@ void DictI::reset(const Dict* dict) {
287
287
}
288
288
289
289
// ------------------------------next-------------------------------------------
290
- // Find the next key-value pair in the dictionary, or return a NULL key and
290
+ // Find the next key-value pair in the dictionary, or return a null key and
291
291
// value.
292
292
void DictI::operator ++(void ) {
293
293
if (_j--) { // Still working in current bin?
@@ -306,5 +306,5 @@ void DictI::operator ++(void) {
306
306
_value = _d->_bin [_i]._keyvals [_j+_j+1 ];
307
307
return ;
308
308
}
309
- _key = _value = NULL ;
309
+ _key = _value = nullptr ;
310
310
}
0 commit comments