Explorar el Código

A bit of safety

Loweel hace 4 años
padre
commit
a9813a91d2
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      matrix.go

+ 4 - 0
matrix.go

@@ -180,6 +180,10 @@ func (c *ByClassifier) enroll() {
 
 func sortMap(unsorted *sync.Map, size int) {
 
+	if size == 0 {
+		size = 1
+	}
+
 	type Myt struct {
 		Name string
 		Num  int64