Commit f982cde
authored
Fix a bug in hash_map_get_next_key_and_data. (ros2#375)
What was happening was that we were incorrectly using the
previous_key for finding our last "spot" in the hash_map
for iteration. That's because of a silly typo.
This wasn't picked up in the tests because the tests also
had a bug; they were reusing the same key pointer for the
previous and the current key, and because of that they
didn't pick up on the bug. Fix both of these issues, which
fixes iteration over the hash map.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>1 parent 53f952f commit f982cde
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
| 542 | + | |
| 543 | + | |
543 | 544 | | |
544 | 545 | | |
545 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
| 435 | + | |
435 | 436 | | |
436 | 437 | | |
437 | 438 | | |
| |||
0 commit comments