diff options
author | Gary Wong <gtw@gnu.org> | 2009-08-28 11:05:15 -0600 |
---|---|---|
committer | Gary Wong <gtw@gnu.org> | 2009-08-28 11:05:15 -0600 |
commit | 65acbd9998ea9125309c192edec99a783202b912 (patch) | |
tree | 28320140cc2fca0fa00623ff77c2760cba7d8f6a | |
parent | 2b6c97bcb50a8cb9442f42e8c72152b4765b385f (diff) |
Don't bother comparing the first cache line with itself.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | decorate-render.c | 4 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2009-08-28 Gary Wong <gtw@gnu.org> + + * decorate-render.c (query_metrics, replace_glyph): Don't + bother comparing the first cache line with itself. + 2009-08-27 Gary Wong <gtw@gnu.org> * decorate-render.c, decorate-render.h: New files. Implement @@ -8,7 +13,7 @@ * decorate-core.c (core_update_window): Issue SetClipRectangles request. - + 2009-08-27 Gary Wong <gtw@gnu.org> * gwm.c (sync_with_callback): Perform the sequence comparison diff --git a/decorate-render.c b/decorate-render.c index c7baef8..78f6243 100644 --- a/decorate-render.c +++ b/decorate-render.c @@ -108,7 +108,7 @@ static void query_metrics( uint32_t c, int *x_off, int *y_off ) { } /* Search for a line to evict. */ - for( i = 0, max = 0; i < METRIC_CACHE_ASSOC; i++ ) + for( i = 1, max = 0; i < METRIC_CACHE_ASSOC; i++ ) if( current_time - metric_cache[ row ][ i ].time > current_time - metric_cache[ row ][ max ].time ) max = i; @@ -142,7 +142,7 @@ static int replace_glyph( uint32_t c ) { int i, max; /* Search for a line to evict. */ - for( i = 0, max = 0; i < METRIC_CACHE_ASSOC; i++ ) { + for( i = 1, max = 0; i < METRIC_CACHE_ASSOC; i++ ) { assert( glyph_cache[ row ][ i ].c != c ); if( current_time - glyph_cache[ row ][ i ].time > current_time - glyph_cache[ row ][ max ].time ) |