mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
Merge branch 'hash-table-docs' into 'master'
ghash: Document the iteration order over a hash table is not defined See merge request GNOME/glib!1381
This commit is contained in:
commit
cf91f0dca9
14
glib/ghash.c
14
glib/ghash.c
@ -99,7 +99,9 @@
|
|||||||
*
|
*
|
||||||
* To call a function for each key and value pair use
|
* To call a function for each key and value pair use
|
||||||
* g_hash_table_foreach() or use an iterator to iterate over the
|
* g_hash_table_foreach() or use an iterator to iterate over the
|
||||||
* key/value pairs in the hash table, see #GHashTableIter.
|
* key/value pairs in the hash table, see #GHashTableIter. The iteration order
|
||||||
|
* of a hash table is not defined, and you must not rely on iterating over
|
||||||
|
* keys/values in the same order as they were inserted.
|
||||||
*
|
*
|
||||||
* To destroy a #GHashTable use g_hash_table_destroy().
|
* To destroy a #GHashTable use g_hash_table_destroy().
|
||||||
*
|
*
|
||||||
@ -209,6 +211,9 @@
|
|||||||
* to iterate over the elements of a #GHashTable. GHashTableIter
|
* to iterate over the elements of a #GHashTable. GHashTableIter
|
||||||
* structures are typically allocated on the stack and then initialized
|
* structures are typically allocated on the stack and then initialized
|
||||||
* with g_hash_table_iter_init().
|
* with g_hash_table_iter_init().
|
||||||
|
*
|
||||||
|
* The iteration order of a #GHashTableIter over the keys/values in a hash
|
||||||
|
* table is not defined.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1088,6 +1093,10 @@ g_hash_table_new_full (GHashFunc hash_func,
|
|||||||
* Initializes a key/value pair iterator and associates it with
|
* Initializes a key/value pair iterator and associates it with
|
||||||
* @hash_table. Modifying the hash table after calling this function
|
* @hash_table. Modifying the hash table after calling this function
|
||||||
* invalidates the returned iterator.
|
* invalidates the returned iterator.
|
||||||
|
*
|
||||||
|
* The iteration order of a #GHashTableIter over the keys/values in a hash
|
||||||
|
* table is not defined.
|
||||||
|
*
|
||||||
* |[<!-- language="C" -->
|
* |[<!-- language="C" -->
|
||||||
* GHashTableIter iter;
|
* GHashTableIter iter;
|
||||||
* gpointer key, value;
|
* gpointer key, value;
|
||||||
@ -2023,6 +2032,9 @@ g_hash_table_foreach_steal (GHashTable *hash_table,
|
|||||||
* items). To remove all items matching a predicate, use
|
* items). To remove all items matching a predicate, use
|
||||||
* g_hash_table_foreach_remove().
|
* g_hash_table_foreach_remove().
|
||||||
*
|
*
|
||||||
|
* The order in which g_hash_table_foreach() iterates over the keys/values in
|
||||||
|
* the hash table is not defined.
|
||||||
|
*
|
||||||
* See g_hash_table_find() for performance caveats for linear
|
* See g_hash_table_find() for performance caveats for linear
|
||||||
* order searches in contrast to g_hash_table_lookup().
|
* order searches in contrast to g_hash_table_lookup().
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user