From af9c518806f6c3d21967cffa3f5e9db5aca9a5c9 Mon Sep 17 00:00:00 2001 From: duanhf2012 Date: Mon, 17 Feb 2020 17:23:15 +0800 Subject: [PATCH] =?UTF-8?q?mapex=E7=A9=BA=E5=86=85=E5=AE=B9=E6=9F=A5?= =?UTF-8?q?=E6=89=BEcore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/mapex.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/mapex.go b/util/mapex.go index e83bfe7..f3402f0 100644 --- a/util/mapex.go +++ b/util/mapex.go @@ -49,6 +49,9 @@ func (m *MapEx) GetHashCode(key interface{}) int { } func (m *MapEx) GetArrayIdByKey(key interface{}) int { + if m.hashMapNum ==0 { + return -1 + } idx := m.GetHashCode(key) % m.hashMapNum if idx > m.hashMapNum { return -1