Browse Source

A bit of safety

Loweel 4 năm trước cách đây
mục cha
commit
a9813a91d2
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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