@matheusbsbs / matheus-bagliano / commits / 6416a865da
Fork 0

fast-export: move global "idents" anonymize hashmap into function

All of the other anonymization functions keep their static mappings inside the function to avoid polluting the global namespace. Let's do the same for "idents", as nobody needs it outside of anonymize_ident_line(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 23, 2020 at 11:25 UTC 6416a865da44ac8e27e5dbcafd6a8b76caf09f5a
1 file changed +1 -1
builtin/fast-export.c
+1 -1
@@ -555,7 +555,6 @@ static char *anonymize_commit_message(const char *old)
555 return xstrfmt("subject %d\n\nbody\n", counter++);
556 }
557
558 -static struct hashmap idents;
558 static char *anonymize_ident(const char *old, size_t len)
559 {
560 static int counter;
@@ -572,6 +571,7 @@ static char *anonymize_ident(const char *old, size_t len)
571 */
572 static void anonymize_ident_line(const char **beg, const char **end)
573 {
574 + static struct hashmap idents;
575 static struct strbuf buffers[] = { STRBUF_INIT, STRBUF_INIT };
576 static unsigned which_buffer;
577