Re: [Mesa-dev] [PATCH 4/3] util: Use set_foreach instead of rolling our own

2015-04-15 Thread Matt Turner
On Wed, Apr 15, 2015 at 2:14 PM, Thomas Helland
thomashellan...@gmail.com wrote:
 This follows the same pattern as in the hash_table.

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

Fix the email address before committing, whoever commits.

 Signed-off-by: Thomas Helland thomashellan...@gmail.com
 ---
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 4/3] util: Use set_foreach instead of rolling our own

2015-04-15 Thread Thomas Helland
This follows the same pattern as in the hash_table.

Reviewed-by: Jason Ekstrand jason.ekstrand at intel.com
Signed-off-by: Thomas Helland thomashellan...@gmail.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 2bcc743..7ff9520 100644
--- a/src/util/set.c
+++ b/src/util/set.c
@@ -196,12 +196,8 @@ set_rehash(struct set *ht, uint32_t new_size_iteration)
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);
-- 
2.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev