mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Improve dictionary lookup for strings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3003 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c4337b9ca9
commit
1601128ae7
4 changed files with 80 additions and 5 deletions
|
@ -562,12 +562,22 @@ o_map_key_at_key(o_map_t *map, const void *key)
|
|||
const void *
|
||||
o_map_value_at_key(o_map_t *map, const void *key)
|
||||
{
|
||||
#if 0
|
||||
const void *value;
|
||||
|
||||
/* Use the grandfather function above... */
|
||||
o_map_key_and_value_at_key(map, 0, &value, key);
|
||||
|
||||
return value;
|
||||
#else
|
||||
o_map_node_t *node;
|
||||
|
||||
/* Try and find the node for KEY. */
|
||||
node = _o_map_node_for_key(map, key);
|
||||
|
||||
if (node != 0)
|
||||
return node->value;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
const void **
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue