diff options
author | Zack Rusin <zack@tungstengraphics.com> | 2008-04-23 13:32:41 -0400 |
---|---|---|
committer | Zack Rusin <zack@tungstengraphics.com> | 2008-04-23 13:32:41 -0400 |
commit | e1180c2d694851ed12e86027aa406ee20546e6d3 (patch) | |
tree | 64d2eb54933e021868bdf26f0d4fe680ffe5b116 /src/gallium/auxiliary/draw/draw_pt_fetch.c | |
parent | 4f93a3a680560940630c44be0066b72a86ff008a (diff) | |
download | external_mesa3d-e1180c2d694851ed12e86027aa406ee20546e6d3.zip external_mesa3d-e1180c2d694851ed12e86027aa406ee20546e6d3.tar.gz external_mesa3d-e1180c2d694851ed12e86027aa406ee20546e6d3.tar.bz2 |
fix the simple hash finding function and use it
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_fetch.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c index a8d4be5..013d16e 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c @@ -67,19 +67,10 @@ static struct translate *cached_translate(struct pt_fetch *fetch, struct translate_key *key) { unsigned hash_key = create_key(key); - struct cso_hash_iter iter = cso_hash_find(fetch->hash, hash_key); - struct translate *translate = 0; - - while (!cso_hash_iter_is_null(iter)) { - void *iter_data = cso_hash_iter_data(iter); - if (memcmp(iter_data, key, sizeof(*key)) == 0) { - /* found */ - translate = cso_hash_iter_data(iter); - break; - } - iter = cso_hash_iter_next(iter); - /*debug_printf("\tOK with %d\n", hash_key);*/ - } + struct translate *translate = (struct translate*) + cso_hash_find_data_from_template(fetch->hash, + hash_key, + key, sizeof(*key)); if (!translate) { /* create/insert */ |