diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-07 20:30:33 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-11-07 20:50:34 +0000 |
commit | 2b32c8b9e572c96ce8ba5c7d43b568f18f6da295 (patch) | |
tree | 5bbac3fa688087fb74d3598105dd50786c68816c /src/cairo-cache.c | |
parent | d15fb9344bf86dd52cda0b43d3dfc49397fd84ec (diff) | |
download | cairo-2b32c8b9e572c96ce8ba5c7d43b568f18f6da295.tar.gz |
[hash] Return lookup entry.
Use the return value to return the result from _cairo_hash_table_lookup()
(as opposed to filling an output parameter on the stack) as this (a)
results in cleaner code (no strict-alias breaking pointer casts), (b)
produces a smaller binary and (c) is measurably faster.
Diffstat (limited to 'src/cairo-cache.c')
-rw-r--r-- | src/cairo-cache.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cairo-cache.c b/src/cairo-cache.c index 1c458dff3..01e5713de 100644 --- a/src/cairo-cache.c +++ b/src/cairo-cache.c @@ -222,14 +222,12 @@ _cairo_cache_thaw (cairo_cache_t *cache) * @key, (which will now be in *entry_return). %FALSE otherwise, (in * which case *entry_return will be %NULL). **/ -cairo_bool_t +void * _cairo_cache_lookup (cairo_cache_t *cache, - cairo_cache_entry_t *key, - cairo_cache_entry_t **entry_return) + cairo_cache_entry_t *key) { return _cairo_hash_table_lookup (cache->hash_table, - (cairo_hash_entry_t *) key, - (cairo_hash_entry_t **) entry_return); + (cairo_hash_entry_t *) key); } /** |