Module: Mesa
Branch: master
Commit: 03e37ec6d720bb5d416e98d6f6d9663086939e4d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=03e37ec6d720bb5d416e98d6f6d9663086939e4d

Author: Thomas Helland <thomashellan...@gmail.com>
Date:   Wed Apr 15 23:08:19 2015 +0200

util: Use set_foreach instead of rolling our own

This follows the same pattern as in the hash_table.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 src/util/set.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/util/set.c b/src/util/set.c
index 3925066395..d71f771807 100644
--- a/src/util/set.c
+++ b/src/util/set.c
@@ -230,12 +230,8 @@ set_rehash(struct set *ht, unsigned new_size_index)
    ht->entries = 0;
    ht->deleted_entries = 0;
 
-   for (entry = old_ht.table;
-        entry != old_ht.table + old_ht.size;
-        entry++) {
-      if (entry_is_present(entry)) {
-         set_add(ht, entry->hash, entry->key);
-      }
+   set_foreach(&old_ht, entry) {
+      set_add(ht, entry->hash, entry->key);
    }
 
    ralloc_free(old_ht.table);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to