summaryrefslogtreecommitdiff
path: root/src/cairo-cache.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-06-03 16:22:26 +0000
committerCarl Worth <cworth@cworth.org>2005-06-03 16:22:26 +0000
commit7c47633b2c74e329f04b9f1ebde4c05c409d73c0 (patch)
tree7f47a900a68d7671e95987a4ab4443dfe95cfd04 /src/cairo-cache.c
parent756e991b91465c6da933368d66f19e54849815dd (diff)
downloadcairo-7c47633b2c74e329f04b9f1ebde4c05c409d73c0.tar.gz
Remove unused cache->refcount and _cairo_cache_reference().
Remove gratuitous nesting as recommended in CODING_STYLE.
Diffstat (limited to 'src/cairo-cache.c')
-rw-r--r--src/cairo-cache.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/cairo-cache.c b/src/cairo-cache.c
index 950f983b4..e7547bc29 100644
--- a/src/cairo-cache.c
+++ b/src/cairo-cache.c
@@ -345,7 +345,6 @@ _cairo_cache_init (cairo_cache_t *cache,
if (cache != NULL){
cache->arrangement = &cache_arrangements[0];
- cache->refcount = 1;
cache->max_memory = max_memory;
cache->used_memory = 0;
cache->live_entries = 0;
@@ -368,31 +367,20 @@ _cairo_cache_init (cairo_cache_t *cache,
}
void
-_cairo_cache_reference (cairo_cache_t *cache)
-{
- _cache_sane_state (cache);
- cache->refcount++;
-}
-
-void
_cairo_cache_destroy (cairo_cache_t *cache)
{
unsigned long i;
- if (cache != NULL) {
+ if (cache == NULL)
+ return;
- _cache_sane_state (cache);
+ _cache_sane_state (cache);
- if (--cache->refcount > 0)
- return;
-
- for (i = 0; i < cache->arrangement->size; ++i) {
- _entry_destroy (cache, i);
- }
+ for (i = 0; i < cache->arrangement->size; ++i)
+ _entry_destroy (cache, i);
- free (cache->entries);
- cache->entries = NULL;
- cache->backend->destroy_cache (cache);
- }
+ free (cache->entries);
+ cache->entries = NULL;
+ cache->backend->destroy_cache (cache);
}
cairo_status_t