Bug 18165

Summary: _cairo_hash_table_insert can pass key_unique = TRUE to _cairo_hash_table_lookup_internal
Product: cairo Reporter: Karl Tomlinson <bugs.freedesktop>
Component: generalAssignee: Keith Packard <keithp>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.6.5   
Hardware: Other   
OS: All   
URL: https://bugzilla.mozilla.org/show_bug.cgi?id=453200
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 17399, 18166    
Attachments: patch

Description Karl Tomlinson 2008-10-21 22:28:05 UTC
Created attachment 19800 [details] [review]
patch

_cairo_hash_table_insert can use key_unique = TRUE when calling
_cairo_hash_table_lookup_internal because the rules don't permit inserting an
entry with an existing key.

This saves on having to search through dead entries (as the first dead can be
used), and means that the cairo_hash_keys_equal_func_t need not be called on
live entries.
Comment 1 Chris Wilson 2008-11-07 12:53:22 UTC
Pushed - it looks sane and benefits from the hash-table policy already in force. In particular this patch had a dramatic impact for my cairo-script test cases, causing a 100-fold reduction in the number of key compares.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.