Skip to content
Snippets Groups Projects
Commit 11a8ecfb authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Change argument order

parent 4c47efcf
No related branches found
No related tags found
1 merge request!265Robot state predictions
......@@ -95,8 +95,8 @@ namespace armarx::armem
findEntryWithLongestPrefixAnd(
const std::map<KeyT, ValueT>& keyValMap,
const std::function<std::optional<KeyT>(KeyT&)>& prefixFunc,
const std::function<bool(const KeyT&, const ValueT&)>& predicate,
const KeyT& key)
const KeyT& key,
const std::function<bool(const KeyT&, const ValueT&)>& predicate)
{
std::optional<KeyT> curKey = key;
......@@ -104,7 +104,7 @@ namespace armarx::armem
do
{
auto iterator = keyValMap.find(curKey.value());
if (iterator != keyValMap.end() && predicate(iterator->first, iterator->second))
if (iterator != keyValMap.end() and predicate(iterator->first, iterator->second))
{
result = iterator;
}
......@@ -240,18 +240,18 @@ namespace armarx::armem
/**
* @brief Find the entry with the most specific key that contains the given ID
* and satisfies the predicate, or `idMap.end()` if no key contains the ID.
* and satisfies the predicate, or `idMap.end()` if no key contains the ID and satisfies
* the predicate.
*
* @see `detail::findEntryWithLongestPrefixAnd()`
*/
template <typename ValueT>
typename std::map<MemoryID, ValueT>::const_iterator
findMostSpecificEntryContainingIDAnd(const std::map<MemoryID, ValueT>& idMap,
const std::function<bool(const MemoryID&, const ValueT&)>& predicate,
const MemoryID& id)
findMostSpecificEntryContainingIDAnd(const std::map<MemoryID, ValueT>& idMap, const MemoryID& id,
const std::function<bool(const MemoryID&, const ValueT&)>& predicate)
{
return detail::findEntryWithLongestPrefixAnd<MemoryID, ValueT>(
idMap, &getMemoryIDParent, predicate, id);
idMap, &getMemoryIDParent, id, predicate);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment