[PATCH 1/2] rbtree.h: Take wine_rb_entry as wine_rb_remove argument type and add new wine_rb_remove_key helper using key.

Jacek Caban jacek at codeweavers.com
Mon Sep 12 06:44:09 CDT 2016


Signed-off-by: Jacek Caban <jacek at codeweavers.com>


Typical wine_rb_remove call looks like this:

1. Get the key from entry (and pass it to wine_rb_remove; it's usually
simple but in cases like delete_glsl_program_entry it requires some
extra efforts)
2. Get entry from the key (involves O(log n) tree lookup)
3. Remove the entry

Steps 1 and 2 are usually totally useless since we already have the
entry. There are some use cases for deleting by key, so I added a
separated helper. d3d11 and wined3d changes are no-op.

---
 dlls/d3d11/state.c           |  8 ++++----
 dlls/d3dcompiler_43/utils.c  |  2 +-
 dlls/ntoskrnl.exe/ntoskrnl.c |  2 +-
 dlls/wined3d/glsl_shader.c   |  2 +-
 include/wine/rbtree.h        | 12 ++++++++----
 programs/winedevice/device.c |  4 ++--
 6 files changed, 17 insertions(+), 13 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-rbtree.h-Take-wine_rb_entry-as-wine_rb_remove-argumen.diff
Type: text/x-patch
Size: 5813 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20160912/4d75adc9/attachment.bin>


More information about the wine-patches mailing list