Closed Bug 1121760 Opened 9 years ago Closed 9 years ago

Remove PL_DHashTable* functions

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(6 files, 1 obsolete file)

PLDHashTable now has both C-style functions (e.g. PL_DHashTableInit()) and C++-style methods (e.g. PLDHashTable::Init()). It would be nice to remove the former to avoid code duplication and make the style more like the rest of the codebase.
Summary: Remove PL_DHashTable* methods → Remove PL_DHashTable* functions
I tried removing PL_DHashTableInit() just to see if there were any unexpected
difficulties. There weren't.

Michael, is this something you'd be interested in continuing? If so, it'd
probably make sense to put each function's removal in a separate patch (to
simplify reviewing) but then land them all at once (to simplify updating
comm-central).
I'll take this, but I have a whole lot of other PLDHashTable clean-up patches I want to land first.
Assignee: nobody → n.nethercote
Attachment #8549265 - Attachment is obsolete: true
Attachment #8660780 - Flags: review?(birunthan)
Attachment #8660767 - Flags: review?(birunthan) → review+
Comment on attachment 8660780 [details] [diff] [review]
(part 2) - Remove PL_DHashTableAdd()

Review of attachment 8660780 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/cache/nsDiskCacheBinding.cpp
@@ +229,5 @@
>      NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
>  
>      // find hash entry for key
> +    auto hashEntry = static_cast<HashTableEntry*>
> +        (table.Add((void *)(uintptr_t) binding->mRecord.HashNumber(), fallible));

Could you remove the space before the * and after the ) while you're here?
Attachment #8660780 - Flags: review?(birunthan) → review+
Attachment #8660781 - Flags: review?(birunthan) → review+
Attachment #8660786 - Flags: review?(birunthan) → review+
Attachment #8660787 - Flags: review?(birunthan) → review+
Comment on attachment 8660788 [details] [diff] [review]
(part 6) - Move all remaining PL_DHash*() functions into PLDHashTable

Review of attachment 8660788 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/glue/pldhash.cpp
@@ +119,5 @@
>    nullptr
>  };
>  
> +/* static */ const PLDHashTableOps*
> +PLDHashTable::StubOps(void)

Please remove `void`.
Attachment #8660788 - Flags: review?(birunthan) → review+
Thank you for the lighting reviews :)
Er, that should be *lightning*...
Blocks: 1205183
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: