Explorar o código

feat:list合并

wangchuanjin hai 1 ano
pai
achega
9d9224fc66
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      p/public.go

+ 1 - 1
p/public.go

@@ -347,7 +347,7 @@ func MergeSortList(o, n interface{}, maxPushSize int) *SortList {
 		*nf = append(*nf, v)
 	}
 	sort.Sort(nf)
-	if len(*nf) > maxPushSize {
+	if maxPushSize > 0 && len(*nf) > maxPushSize {
 		*nf = (*nf)[:maxPushSize]
 	}
 	return nf