Fix: bt_g_hash_table_contains(): handle `NULL`/0 values
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 23 Aug 2018 15:35:43 +0000 (11:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:35 +0000 (18:19 -0400)
commit72f3da6dedd06d56613466efbd6492b50c907ab4
tree8f548d1e9d95111ecba22974a5e258d103583376
parent3399ebd249b9b470cde72e0a16c8f2a72cc53dac
Fix: bt_g_hash_table_contains(): handle `NULL`/0 values

Issue
=====
g_hash_table_lookup() returns `NULL` if the key is not found, but also
when the value is actually `NULL` (or 0). Therefore
bt_g_hash_table_contains() returns false when there's actually a
`NULL`/0 value for the given key.

Solution
========
Use g_hash_table_lookup_extended() which truly returns whether or not
the given key was found, and discard the returned value.

Known drawbacks
===============
None.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
include/babeltrace/compat/glib-internal.h
This page took 0.024781 seconds and 4 git commands to generate.