1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

codership/wsrep-lib#35 Rewrote member_index() to use iterators

Use iterators for scanning members vector in order to avoid
issues with integer signedness and range checks. The vector is
usually rather small and not in hot codepath, so performance
is here not an issue.

Added unit test for member_index() method.
This commit is contained in:
Teemu Ollakka
2018-12-15 13:46:42 +00:00
parent 80dcf4b6d2
commit 36dbb37645
4 changed files with 50 additions and 12 deletions

View File

@ -116,7 +116,10 @@ namespace wsrep
}
/**
* Return member index in the view
* Return member index in the view.
*
* @return Member index if found, -1 if member is not present
* in the view.
*/
int member_index(const wsrep::id& member_id) const;