]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
hash: Add a comment.
authorBruno Haible <bruno@clisp.org>
Tue, 18 Nov 2025 01:18:54 +0000 (02:18 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 18 Nov 2025 01:18:54 +0000 (02:18 +0100)
* lib/hash.c (struct hash_entry): Add comment about an invariant.

ChangeLog
lib/hash.c

index 823398850da4fa79758f4d74e55471dc6af0f1b1..e92c81a182fe141a424f857f3c36e8c192694582 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-11-17  Bruno Haible  <bruno@clisp.org>
+
+       hash: Add a comment.
+       * lib/hash.c (struct hash_entry): Add comment about an invariant.
+
 2025-11-17  Paul Eggert  <eggert@cs.ucla.edu>
 
        openat2: follow OS re EFTYPE/EMLINK/ELOOP
index f5518a7f43cf0701771fad2193f917d7863f54fa..4d07c8b2b050cc88aa8f0ce77ea875e1c97a8f58 100644 (file)
@@ -49,6 +49,8 @@ struct hash_entry
   {
     void *data;
     struct hash_entry *next;
+    /* Invariant: If DATA is NULL, this entry is an unused bucket head,
+       and therefore NEXT is NULL as well.  */
   };
 
 struct hash_table