From: Jeff Hostetler <git@jeffhostetler.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, jonathantanmy@google.com,
Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH v4 2/6] oidmap: add oidmap iterator methods
Date: Thu, 16 Nov 2017 18:07:39 +0000 [thread overview]
Message-ID: <20171116180743.61353-3-git@jeffhostetler.com> (raw)
In-Reply-To: <20171116180743.61353-1-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
Add the usual map iterator functions to oidmap.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
---
oidmap.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/oidmap.h b/oidmap.h
index 18f54cd..d3cd2bb 100644
--- a/oidmap.h
+++ b/oidmap.h
@@ -65,4 +65,26 @@ extern void *oidmap_put(struct oidmap *map, void *entry);
*/
extern void *oidmap_remove(struct oidmap *map, const struct object_id *key);
+
+struct oidmap_iter {
+ struct hashmap_iter h_iter;
+};
+
+static inline void oidmap_iter_init(struct oidmap *map, struct oidmap_iter *iter)
+{
+ hashmap_iter_init(&map->map, &iter->h_iter);
+}
+
+static inline void *oidmap_iter_next(struct oidmap_iter *iter)
+{
+ return hashmap_iter_next(&iter->h_iter);
+}
+
+static inline void *oidmap_iter_first(struct oidmap *map,
+ struct oidmap_iter *iter)
+{
+ oidmap_iter_init(map, iter);
+ return oidmap_iter_next(iter);
+}
+
#endif
--
2.9.3
next prev parent reply other threads:[~2017-11-16 18:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 18:07 [PATCH v4 0/6] Partial clone part 1: object filtering Jeff Hostetler
2017-11-16 18:07 ` [PATCH v4 1/6] dir: allow exclusions from blob in addition to file Jeff Hostetler
2017-11-16 18:07 ` Jeff Hostetler [this message]
2017-11-16 18:07 ` [PATCH v4 3/6] oidset: add iterator methods to oidset Jeff Hostetler
2017-11-16 18:07 ` [PATCH v4 4/6] list-objects: filter objects in traverse_commit_list Jeff Hostetler
2017-11-16 20:21 ` Jonathan Tan
2017-11-16 21:49 ` Jeff Hostetler
2017-11-16 21:57 ` Jeff King
2017-11-17 2:14 ` Junio C Hamano
2017-11-17 15:42 ` Jeff Hostetler
2017-11-17 22:19 ` Jeff King
2017-11-16 18:07 ` [PATCH v4 5/6] rev-list: add list-objects filtering support Jeff Hostetler
2017-11-16 20:43 ` Jonathan Tan
2017-11-17 2:14 ` Junio C Hamano
2017-11-17 17:36 ` Jeff Hostetler
2017-11-16 18:07 ` [PATCH v4 6/6] pack-objects: add list-objects filtering Jeff Hostetler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171116180743.61353-3-git@jeffhostetler.com \
--to=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jeffhost@microsoft.com \
--cc=jonathantanmy@google.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.