Skip to content

Commit

Permalink
2102: Fix map_lexicographical compare bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kduske committed Oct 14, 2021
1 parent b6e2515 commit 1043f07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kdl/include/kdl/map_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace kdl {
return false;
} else {
const V& lhs_value = lhs.second;
const V& rhs_value = lhs.second;
const V& rhs_value = rhs.second;
return value_cmp(lhs_value, rhs_value);
}
});
Expand Down
7 changes: 7 additions & 0 deletions lib/kdl/test/src/map_utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ namespace kdl {
{ 2, 3 },
{ 3, 4 },
});
test_map_lexicographical_compare<int, int>(-1, {
{ 1, 2 },
{ 2, 3 }
}, {
{ 1, 2 },
{ 2, 4 }
});
}

template<typename K, typename V>
Expand Down

0 comments on commit 1043f07

Please sign in to comment.