diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-03 17:01:07 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-03 17:01:07 -0700 |
commit | a95f1e1418b0a14f29365202d0df11b76c2578bb (patch) | |
tree | b8f7975903b4c03d9eb293891f774be1df02773f /node | |
parent | 6eb9289367a1c8661d38895558b0f01eac0ddd5e (diff) | |
download | infinitytier-a95f1e1418b0a14f29365202d0df11b76c2578bb.tar.gz infinitytier-a95f1e1418b0a14f29365202d0df11b76c2578bb.zip |
Eliminate redundant SharedPtr assignment.
Diffstat (limited to 'node')
-rw-r--r-- | node/Switch.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp index 8f1fed66..5e120341 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -771,13 +771,10 @@ bool Switch::_trySend(const Packet &packet,bool encrypt) if (peer) { const uint64_t now = RR->node->now(); - SharedPtr<Peer> via; - Path *viaPath; - if ((viaPath = peer->getBestPath(now))) { - via = peer; - } else { - via = RR->topology->getBestSupernode(); - if (!(via)||(!(viaPath = via->getBestPath(now)))) + Path *viaPath = peer->getBestPath(now); + if (!viaPath) { + SharedPtr<Peer> sn(RR->topology->getBestSupernode()); + if (!(sn)||(!(viaPath = sn->getBestPath(now)))) return false; } |