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

[PATCH] pack-bitmap-write: use hashwrite_be32() in write_hash_cache()

From
René Scharfe <l.s.r@web.de>
Date
Sep 6, 2020, 08:59 UTC
Message-ID
<1143b9e0-3adf-095f-78cf-2f8d8c2bd368@web.de>

Call hashwrite_be32() instead of open-coding it. This is shorter and easier to read.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 pack-bitmap-write.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index a7a4964b50..5e998bdaa7 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -503,8 +503,7 @@ static void write_hash_cache(struct hashfile *f,

 	for (i = 0; i < index_nr; ++i) {
 		struct object_entry *entry = (struct object_entry *)index[i];
-		uint32_t hash_value = htonl(entry->hash);
-		hashwrite(f, &hash_value, sizeof(hash_value));
+		hashwrite_be32(f, entry->hash);
 	}
 }

--
2.28.0
Next: Taylor Blau
Message 1 of 4 in “pack-bitmap-write: use hashwrite_be32() in write_hash_cache()”
  1. pack-bitmap-write: use hashwrite_be32() in write_hash_cache()René Scharfe, Sep 6, 2020
  2. Taylor BlauSep 6, 2020
  3. Jeff KingSep 7, 2020
  4. Taylor BlauSep 7, 2020

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.