Browse Source

A bit of safety

Loweel 4 years ago
parent
commit
a9813a91d2
1 changed files with 4 additions and 0 deletions
  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