Bug 66576

Summary: [PATCH] two small fixes for dbus hash: remove dead code, fix comments and remove redundant AND operation
Product: dbus Reporter: Chengwei Yang <chengwei.yang.cn>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED MOVED QA Contact: D-Bus Maintainers <dbus>
Severity: trivial    
Priority: low CC: chengwei.yang.cn, msniko14, walters
Version: 1.5Keywords: patch
Hardware: All   
OS: All   
Whiteboard: sort of review-
i915 platform: i915 features:
Attachments: [PATCH 1/2] Hash: clean up dead code and fix comments
[PATCH 2/2] Hash: remove redundant AND operation

Description Chengwei Yang 2013-07-04 08:02:53 UTC

    
Comment 1 Chengwei Yang 2013-07-04 08:04:30 UTC
Created attachment 82007 [details] [review]
[PATCH 1/2] Hash: clean up dead code and fix comments
Comment 2 Chengwei Yang 2013-07-04 08:04:59 UTC
Created attachment 82008 [details] [review]
[PATCH 2/2] Hash: remove redundant AND operation
Comment 3 Simon McVittie 2013-08-22 18:10:22 UTC
Comment on attachment 82008 [details] [review]
[PATCH 2/2] Hash: remove redundant AND operation

Review of attachment 82008 [details] [review]:
-----------------------------------------------------------------

If it's redundant, the compiler will hopefully remove it for us :-)

(I don't trust myself not to break dbus-hash. I don't think any of the current maintainers really understand it, and my thoughts on it are basically "it's bad that libdbus has to contain a hash table and can't use a library".)
Comment 4 Colin Walters 2013-10-10 16:25:15 UTC
(In reply to comment #3)
> Comment on attachment 82008 [details] [review] [review]
> [PATCH 2/2] Hash: remove redundant AND operation
> 
> Review of attachment 82008 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> If it's redundant, the compiler will hopefully remove it for us :-)

It looks right to me, RANDOM_INDEX() clearly also does masking.
Comment 5 Simon McVittie 2013-10-10 17:25:38 UTC
(In reply to comment #4)
> It looks right to me, RANDOM_INDEX() clearly also does masking.

If you're sufficiently confident about these, please test and apply. I'm not going to make non-critical changes to this module myself - I think the necessary time for me to be sure about a positive review exceeds the benefit.
Comment 6 GitLab Migration User 2018-10-12 21:16:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/85.

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.