diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-01-10 15:16:03 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-01-10 15:16:03 +0100 |
commit | 47dda4f61512f6047f2b1dcccd1943aab74726e3 (patch) | |
tree | a1425a9dbff58b97ef5dcdf169e0d65439513527 /src/cidr.cpp | |
parent | ae10286658d6bb70e5e22526a004ec1b233f6fba (diff) |
Reduce std::string::substr() usage
substr() returns a new string while erase() and assign() modify the existing one
Diffstat (limited to 'src/cidr.cpp')
-rw-r--r-- | src/cidr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cidr.cpp b/src/cidr.cpp index 8d199353d..250ad9c69 100644 --- a/src/cidr.cpp +++ b/src/cidr.cpp @@ -53,8 +53,8 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr } else { - address_copy = address.substr(username_addr_pos + 1); - cidr_copy = cidr_mask.substr(username_mask_pos + 1); + address_copy.assign(address, username_addr_pos + 1, std::string::npos); + cidr_copy.assign(cidr_mask, username_mask_pos + 1, std::string::npos); } } else |