summaryrefslogtreecommitdiff
path: root/src/DHTTokenTracker.cc
diff options
context:
space:
mode:
authorNils Maier <maierman@web.de>2013-08-21 05:06:53 +0200
committerNils Maier <maierman@web.de>2013-08-21 05:56:17 +0200
commit8526ceeb452d23d7aa73d01c6cb0fc8ae5e0377b (patch)
tree825b4f5d2a0f18331fbbf24773e80ee0b44b50dc /src/DHTTokenTracker.cc
parentd8f44ef4f6c5ad86b08658ecba41a84b775b6e69 (diff)
Convert to autos and ranged loops
Diffstat (limited to 'src/DHTTokenTracker.cc')
-rw-r--r--src/DHTTokenTracker.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/DHTTokenTracker.cc b/src/DHTTokenTracker.cc
index 7139f517..3cec3aa1 100644
--- a/src/DHTTokenTracker.cc
+++ b/src/DHTTokenTracker.cc
@@ -91,8 +91,8 @@ bool DHTTokenTracker::validateToken(const std::string& token,
const unsigned char* infoHash,
const std::string& ipaddr, uint16_t port) const
{
- for(int i = 0; i < 2; ++i) {
- if(generateToken(infoHash, ipaddr, port, secret_[i]) == token) {
+ for(auto & elem : secret_) {
+ if(generateToken(infoHash, ipaddr, port, elem) == token) {
return true;
}
}