diff options
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/describe.c | 4 | ||||
| -rw-r--r-- | builtin/difftool.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/builtin/describe.c b/builtin/describe.c index e9267b5c9c..8cf2cd992d 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -333,8 +333,8 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst) struct commit_name *n; init_commit_names(&commit_names); - n = hashmap_iter_first(&names, &iter); - for (; n; n = hashmap_iter_next(&iter)) { + hashmap_for_each_entry(&names, &iter, n, struct commit_name, + entry /* member name */) { c = lookup_commit_reference_gently(the_repository, &n->peeled, 1); if (c) diff --git a/builtin/difftool.c b/builtin/difftool.c index 4a37b3edee..dd94179b68 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -538,8 +538,8 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix, * temporary file to both the left and right directories to show the * change in the recorded SHA1 for the submodule. */ - hashmap_iter_init(&submodules, &iter); - while ((entry = hashmap_iter_next(&iter))) { + hashmap_for_each_entry(&submodules, &iter, entry, + struct pair_entry, entry /* member name */) { if (*entry->left) { add_path(&ldir, ldir_len, entry->path); ensure_leading_directories(ldir.buf); @@ -557,8 +557,8 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix, * shows only the link itself, not the contents of the link target. * This loop replicates that behavior. */ - hashmap_iter_init(&symlinks2, &iter); - while ((entry = hashmap_iter_next(&iter))) { + hashmap_for_each_entry(&symlinks2, &iter, entry, + struct pair_entry, entry /* member name */) { if (*entry->left) { add_path(&ldir, ldir_len, entry->path); ensure_leading_directories(ldir.buf); |
