[fpc-devel] Who maintains TDictionary? // Re: RFC: Improvements for TDictionary and other hash containers

Martin Frb lazarus at mfriebe.de
Tue Apr 15 18:52:06 CEST 2025


On 15/04/2025 14:16, Martin Frb via fpc-devel wrote:
> Quick question
>
> When re-using known hash in rehash
> https://gitlab.com/martin_frb/fpc-src/-/commit/9b398efb33897b3b5e98678033ddaafd1bcea883 
>
>
>
> Rehash is (mostly?) used for resize.
> But an inherited class could change the hash algorithm and call it.
>
> So there need to be a way to force new hashes.

Since the method is virtual the options are more limited.

- New params wont work
- A new method must still call the old method, in case it is overriden.

So I introduced a wrapper, setting a flag in a private field.
https://gitlab.com/martin_frb/fpc-src/-/commit/bf07831d7eaef3b06a63ac3ed72fae1fd19562ae

Reasonable?


More information about the fpc-devel mailing list