mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
refactor RemoteList::Index class
* remove unused method equals() * default-initialize member variables Signed-off-by: Heiko Hund <heiko@openvpn.net>
This commit is contained in:
parent
08a02669c5
commit
8e16246516
@ -212,23 +212,13 @@ namespace openvpn {
|
||||
// The primary index is the remote list index.
|
||||
// The secondary index is the index into the
|
||||
// Item's IP address list (res_addr_list).
|
||||
class Index
|
||||
struct Index
|
||||
{
|
||||
public:
|
||||
Index()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
void reset() { primary_ = secondary_ = 0; }
|
||||
void reset_secondary() { secondary_ = 0; }
|
||||
|
||||
void reset()
|
||||
{
|
||||
primary_ = secondary_ = 0;
|
||||
}
|
||||
|
||||
void reset_secondary()
|
||||
{
|
||||
secondary_ = 0;
|
||||
}
|
||||
size_t primary() const { return primary_; }
|
||||
size_t secondary() const { return secondary_; }
|
||||
|
||||
// return true if primary index was incremented
|
||||
bool increment(const size_t pri_len, const size_t sec_len)
|
||||
@ -244,17 +234,9 @@ namespace openvpn {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool equals(const Index& other) const
|
||||
{
|
||||
return primary_ == other.primary_ && secondary_ == other.secondary_;
|
||||
}
|
||||
|
||||
size_t primary() const { return primary_; }
|
||||
size_t secondary() const { return secondary_; }
|
||||
|
||||
private:
|
||||
size_t primary_;
|
||||
size_t secondary_;
|
||||
size_t primary_ = 0;
|
||||
size_t secondary_ = 0;
|
||||
};
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user