mirror of
https://github.com/CPunch/Laika.git
synced 2024-12-25 12:20:05 +00:00
minor refactoring, only call laikaT_getTime() once
This commit is contained in:
parent
770e34463e
commit
3034c3bd8b
@ -433,11 +433,10 @@ void laikaC_sweepPeersTask(struct sLaika_taskService *service, struct sLaika_tas
|
||||
struct sLaika_peer *peer;
|
||||
struct sLaika_peerInfo *pInfo;
|
||||
size_t i = 0;
|
||||
long currTime;
|
||||
long currTime = laikaT_getTime();
|
||||
|
||||
while (laikaC_iterPeersNext(cnc, &i, &peer)) {
|
||||
pInfo = GETPINFOFROMPEER(peer);
|
||||
currTime = laikaT_getTime();
|
||||
|
||||
/* peer has been silent for a while, kill 'em */
|
||||
if (currTime - pInfo->lastPing > LAIKA_PEER_TIMEOUT) {
|
||||
|
Loading…
Reference in New Issue
Block a user