git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/3] list-objects-filter: use kh_size API

From
EWEric Wong <e@80x24.org>
Date
Mar 28, 2024, 10:13 UTC
Message-ID
<20240328101356.300374-2-e@80x24.org>
In-Reply-To
<20240328101356.300374-1-e@80x24.org>

In order to ease a potential migration to from khash to khashl, use the kh_size() macro instead of accessing the .size field directly.

Signed-off-by: Eric Wong <e@80x24.org>
---
 list-objects-filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/list-objects-filter.c b/list-objects-filter.c
index 4346f8da45..440f112d23 100644
--- a/list-objects-filter.c
+++ b/list-objects-filter.c
@@ -704,7 +704,7 @@ static void filter_combine__free(void *filter_data)
 	for (sub = 0; sub < d->nr; sub++) {
 		list_objects_filter__free(d->sub[sub].filter);
 		oidset_clear(&d->sub[sub].seen);
-		if (d->sub[sub].omits.set.size)
+		if (kh_size(&d->sub[sub].omits.set))
 			BUG("expected oidset to be cleared already");
 	}
 	free(d->sub);
Previous: Eric WongNext: Eric Wong
Message 2 of 7 in “switch to tombstone-free khashl table”
  1. 0/3 switch to tombstone-free khashl tableEric Wong, Mar 28, 2024
  2. 1/3 list-objects-filter: use kh_size APIEric Wong, Mar 28, 2024
  3. 2/3 treewide: switch to khashl for memory savingsEric Wong, Mar 28, 2024
  4. 3/3 khashl: fix ensemble lookups on empty tableEric Wong, Mar 28, 2024
  5. oops, forgot [v2]Eric Wong, Mar 28, 2024
  6. Junio C HamanoMar 28, 2024
  7. Eric WongMar 28, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.