Explorar o código

import updater effeciency

Darien Raymond %!s(int64=8) %!d(string=hai) anos
pai
achega
f87b0fcde7
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      transport/internet/kcp/connection.go

+ 2 - 1
transport/internet/kcp/connection.go

@@ -147,9 +147,10 @@ func (v *Updater) Run() {
 		if v.shouldTerminate() {
 			return
 		}
+		interval := v.Interval()
 		for v.shouldContinue() {
 			v.updateFunc()
-			time.Sleep(v.Interval())
+			time.Sleep(interval)
 		}
 	}
 }