[gegl] buffer: further early bailing to avoid traversing full tile cache



commit df4e2bcb426878b8da43d6fa7004d0fa907906ce
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Sun Apr 1 22:07:00 2012 +0100

    buffer: further early bailing to avoid traversing full tile cache

 gegl/buffer/gegl-tile-handler-cache.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/gegl/buffer/gegl-tile-handler-cache.c b/gegl/buffer/gegl-tile-handler-cache.c
index e789e51..79ad119 100644
--- a/gegl/buffer/gegl-tile-handler-cache.c
+++ b/gegl/buffer/gegl-tile-handler-cache.c
@@ -274,15 +274,18 @@ gegl_tile_handler_cache_command (GeglTileSource  *tile_store,
           if (gegl_cl_is_accelerated ())
             gegl_buffer_cl_cache_flush2 (GEGL_TILE_HANDLER_CACHE (tile_store), NULL);
 
-          for (link = g_queue_peek_head_link (cache_queue); link; link = link->next)
+          if (cache->count)
             {
-              CacheItem *item = link->data;
-              GeglTile  *tile = item->tile;
-
-              if (tile != NULL &&
-                  item->handler == cache)
+              for (link = g_queue_peek_head_link (cache_queue); link; link = link->next)
                 {
-                  gegl_tile_store (tile);
+                  CacheItem *item = link->data;
+                  GeglTile  *tile = item->tile;
+
+                  if (tile != NULL &&
+                      item->handler == cache)
+                    {
+                      gegl_tile_store (tile);
+                    }
                 }
             }
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]