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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user