瀏覽代碼

Remove redundant check

gabrielseibel1 1 年之前
父節點
當前提交
a51ddebde7
共有 1 個文件被更改,包括 1 次插入5 次删除
  1. 1 5
      models/api_host.go

+ 1 - 5
models/api_host.go

@@ -97,10 +97,6 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host {
 	h.IsDefault = a.IsDefault
 	h.NatType = currentHost.NatType
 	h.TurnEndpoint = currentHost.TurnEndpoint
-	if h.PersistentKeepalive == 0 {
-		h.PersistentKeepalive = time.Duration(a.PersistentKeepalive)
-	} else {
-		h.PersistentKeepalive = time.Duration(a.PersistentKeepalive)
-	}
+	h.PersistentKeepalive = time.Duration(a.PersistentKeepalive)
 	return &h
 }