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

[PATCH v2 1/3] pack-bitmap-write: use const for hashes

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 19, 2022, 15:26 UTC
Message-ID
<a09fdbb8f3e42ff657cc6a0e66fde420afbe2af1.1658244366.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1292.v2.git.1658244366.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>

The next change will use a const array when calling this method. There is no need for the non-const version, so let's do this cleanup quickly.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
 pack-bitmap-write.c | 2 +-
 pack-bitmap.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index c43375bd344..4fcfaed428f 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -683,7 +683,7 @@ static void write_hash_cache(struct hashfile *f,
 	}
 }
 
-void bitmap_writer_set_checksum(unsigned char *sha1)
+void bitmap_writer_set_checksum(const unsigned char *sha1)
 {
 	hashcpy(writer.pack_checksum, sha1);
 }
diff --git a/pack-bitmap.h b/pack-bitmap.h
index 3d3ddd77345..f3a57ca065f 100644
--- a/pack-bitmap.h
+++ b/pack-bitmap.h
@@ -75,7 +75,7 @@ int bitmap_has_oid_in_uninteresting(struct bitmap_index *, const struct object_i
 off_t get_disk_usage_from_bitmap(struct bitmap_index *, struct rev_info *);
 
 void bitmap_writer_show_progress(int show);
-void bitmap_writer_set_checksum(unsigned char *sha1);
+void bitmap_writer_set_checksum(const unsigned char *sha1);
 void bitmap_writer_build_type_index(struct packing_data *to_pack,
 				    struct pack_idx_entry **index,
 				    uint32_t index_nr);
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee via GitGitGadget
Message 5 of 8 in “midx: reduce memory pressure while writing bitmaps”
  1. midx: reduce memory pressure while writing bitmapsDerrick Stolee via GitGitGadget, Jul 18, 2022
  2. Ævar Arnfjörð BjarmasonJul 18, 2022
  3. Derrick StoleeJul 19, 2022
  4. 0/3 midx: reduce memory pressure while writing bitmapsDerrick Stolee via GitGitGadget, Jul 19, 2022
  5. 1/3 pack-bitmap-write: use const for hashesDerrick Stolee via GitGitGadget, Jul 19, 2022
  6. 2/3 midx: extract bitmap write setupDerrick Stolee via GitGitGadget, Jul 19, 2022
  7. 3/3 midx: reduce memory pressure while writing bitmapsDerrick Stolee via GitGitGadget, Jul 19, 2022
  8. Junio C HamanoJul 19, 2022

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.