1
0
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:
CPunch 2022-08-03 15:39:15 -05:00
parent 770e34463e
commit 3034c3bd8b

View File

@ -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) {