mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Eliminate redundant SharedPtr assignment.
This commit is contained in:
parent
6eb9289367
commit
a95f1e1418
1 changed files with 4 additions and 7 deletions
|
@ -771,13 +771,10 @@ bool Switch::_trySend(const Packet &packet,bool encrypt)
|
||||||
if (peer) {
|
if (peer) {
|
||||||
const uint64_t now = RR->node->now();
|
const uint64_t now = RR->node->now();
|
||||||
|
|
||||||
SharedPtr<Peer> via;
|
Path *viaPath = peer->getBestPath(now);
|
||||||
Path *viaPath;
|
if (!viaPath) {
|
||||||
if ((viaPath = peer->getBestPath(now))) {
|
SharedPtr<Peer> sn(RR->topology->getBestSupernode());
|
||||||
via = peer;
|
if (!(sn)||(!(viaPath = sn->getBestPath(now))))
|
||||||
} else {
|
|
||||||
via = RR->topology->getBestSupernode();
|
|
||||||
if (!(via)||(!(viaPath = via->getBestPath(now))))
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue