projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13eeefe
)
hashmap: add helper to test if iterator is still at beginning
author
Lennart Poettering
<lennart@poettering.net>
Tue, 13 Apr 2021 15:20:58 +0000
(17:20 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 25 May 2021 13:47:09 +0000
(15:47 +0200)
src/basic/hashmap.h
patch
|
blob
|
history
diff --git
a/src/basic/hashmap.h
b/src/basic/hashmap.h
index c855f39b1d37389cdbca0c7d025f0a1268d6f401..f7ade2e774f377a7b521170aa48e05c15b32a233 100644
(file)
--- a/
src/basic/hashmap.h
+++ b/
src/basic/hashmap.h
@@
-51,6
+51,7
@@
typedef struct {
#define _IDX_ITERATOR_FIRST (UINT_MAX - 1)
#define ITERATOR_FIRST ((Iterator) { .idx = _IDX_ITERATOR_FIRST, .next_key = NULL })
+#define ITERATOR_IS_FIRST(i) ((i).idx == _IDX_ITERATOR_FIRST)
/* Macros for type checking */
#define PTR_COMPATIBLE_WITH_HASHMAP_BASE(h) \