Closed Bug 1727422 Opened 3 months ago Closed 3 months ago

Support arbitrary integer keys in nsTHashMap

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: nika, Assigned: nika)

Details

Attachments

(1 file)

Currently all integer keys need to use one of the explicit key types provided in nsHashKeys.cpp, such as nsUint32HashKey or nsUint64HashKey. Unfortunately this is somewhat limiting, as things like signed hash keys aren't supported, and instead need to use the unsigned variant.

It should be simple enough to make a generic nsIntegralHashKey<T> which supports all integral types (and potentially enum types), and provide type aliases for compatibility with the old names like nsUint32HashKey, as well as make nsTHashMap and nsTHashSet support all integral types with SFINAE in nsKeyClass.

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.