Bug 18165 - _cairo_hash_table_insert can pass key_unique = TRUE to _cairo_hash_table_lookup_internal
Summary: _cairo_hash_table_insert can pass key_unique = TRUE to _cairo_hash_table_look...
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.6.5
Hardware: Other All
: medium normal
Assignee: Keith Packard
QA Contact: cairo-bugs mailing list
URL: https://bugzilla.mozilla.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks: 17399 18166
  Show dependency treegraph
 
Reported: 2008-10-21 22:28 UTC by Karl Tomlinson
Modified: 2008-11-07 12:53 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch (1.67 KB, patch)
2008-10-21 22:28 UTC, Karl Tomlinson
Details | Splinter Review

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.