Overview
| Artifact ID: | a6e5e4c802b119d93d76cab7a08c907bbdcba8d2164d647e037180eddbf5e2fc |
|---|---|
| Ticket: | 236d18f49ba2bd9b98b0906b321fe9ca4a60e6dd
More efficient Tcl_FindHashEntry() |
| User & Date: | jan.nijtmans on 2025-04-11 10:32:40 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
The function Tcl_FindHashEntry() is implemented like: <pre> #define Tcl_FindHashEntry(tablePtr, key) \ (*((tablePtr)->findProc))(tablePtr, (const char *)(key)) </pre> while the findProc is implemented as: <pre> static Tcl_HashEntry * FindHashEntry( Tcl_HashTable *tablePtr, /* Table in which to lookup entry. */ const char *key) /* Key to use to find matching entry. */ { return CreateHashEntry(tablePtr, key, NULL); } </pre> This means we can do better. Why not just call the createProc directly with it's last NULL parameter (which means don't create anything) This also means that findProc is not used any more, and could be removed altogether. Only .. we cannot remove it yet, because it might be used by Tcl 9.0-compiled extensions. Since the Tcl_HashTable content is not documented, this is 100% upwards and downwards compatible. - foundin changed to: "9.1"
- is_private changed to: "0"
- login: "jan.nijtmans"
- priority changed to: "5 Medium"
- private_contact changed to: "0c50e5320704d174412e57b873d8932de15303e0"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "jan.nijtmans"
- subsystem changed to: "69. Other"
- title changed to: "More efficient Tcl_FindHashEntry()"
- type changed to: "Patch"