aboutsummaryrefslogtreecommitdiff
path: root/qobject/qdict.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-04-15 10:30:47 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-04-30 06:51:15 +0200
commit7b1cd1c65abad70b26fbe9b11991bd88f0d956e1 (patch)
tree33210bd085fd63afb53ef3db5319f524a8e325f5 /qobject/qdict.c
parent2f2ec111795119b2e020bc0cbf4b5f42878574b2 (diff)
qobject: Eliminate qdict_iter(), use qdict_first(), qdict_next()
qdict_iter() has just three uses and no test coverage. Replace by qdict_first(), qdict_next() for more concise code and less type punning. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200415083048.14339-5-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'qobject/qdict.c')
-rw-r--r--qobject/qdict.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 3d8c2f7bbc..526de54ceb 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -298,25 +298,6 @@ const char *qdict_get_try_str(const QDict *qdict, const char *key)
return qstr ? qstring_get_str(qstr) : NULL;
}
-/**
- * qdict_iter(): Iterate over all the dictionary's stored values.
- *
- * This function allows the user to provide an iterator, which will be
- * called for each stored value in the dictionary.
- */
-void qdict_iter(const QDict *qdict,
- void (*iter)(const char *key, QObject *obj, void *opaque),
- void *opaque)
-{
- int i;
- QDictEntry *entry;
-
- for (i = 0; i < QDICT_BUCKET_MAX; i++) {
- QLIST_FOREACH(entry, &qdict->table[i], next)
- iter(entry->key, entry->value, opaque);
- }
-}
-
static QDictEntry *qdict_next_entry(const QDict *qdict, int first_bucket)
{
int i;