projects
/
cparser
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup: Add and use macro MAX().
[cparser]
/
adt
/
hashset.c.inl
diff --git
a/adt/hashset.c.inl
b/adt/hashset.c.inl
index
06f4312
..
2782200
100644
(file)
--- a/
adt/hashset.c.inl
+++ b/
adt/hashset.c.inl
@@
-384,9
+384,7
@@
static inline void maybe_shrink(HashSet *self)
return;
resize_to = ceil_po2(size);
return;
resize_to = ceil_po2(size);
-
- if (resize_to < 4)
- resize_to = 4;
+ resize_to = MAX(resize_to, 4);
resize(self, resize_to);
}
resize(self, resize_to);
}
@@
-502,8
+500,7
@@
void hashset_remove(HashSet *self, ConstKeyType key)
*/
static inline void init_size(HashSet *self, size_t initial_size)
{
*/
static inline void init_size(HashSet *self, size_t initial_size)
{
- if (initial_size < 4)
- initial_size = 4;
+ initial_size = MAX(initial_size, 4);
self->entries = Alloc(initial_size);
SetRangeEmpty(self->entries, initial_size);
self->entries = Alloc(initial_size);
SetRangeEmpty(self->entries, initial_size);