mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-13 19:27:32 +08:00
mapex空内容查找core
This commit is contained in:
@@ -49,6 +49,9 @@ func (m *MapEx) GetHashCode(key interface{}) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *MapEx) GetArrayIdByKey(key interface{}) int {
|
func (m *MapEx) GetArrayIdByKey(key interface{}) int {
|
||||||
|
if m.hashMapNum ==0 {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
idx := m.GetHashCode(key) % m.hashMapNum
|
idx := m.GetHashCode(key) % m.hashMapNum
|
||||||
if idx > m.hashMapNum {
|
if idx > m.hashMapNum {
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
Reference in New Issue
Block a user