// Get the id for the given string,
// optionally creating one if it doesn't exist
Get the id for the given string,
optionally creating one if it doesn't exist
// Get the id for the given string // optionally creating one if it doesn ' t exist
func (m *Map) Get(s string, create bool) uint64 {
	bucket := m.getBucket(s)
	bucket.RLock()
	id, exists := bucket.lookup[s]
	bucket.RUnlock()
	if exists || create == false {
		return id
	}
	bucket.Lock()
	defer bucket.Unlock()
	id, exists = bucket.lookup[s]
	if exists {
		return id
	}
	id = bucket.counter
	bucket.lookup[s] = id
	bucket.counter += m.jump
	return id
}
func ( m * Map ) Get ( s string , create bool ) uint64 { bucket := m . getBucket ( s ) bucket . RLock ( ) id , exists := bucket . lookup [ s ] bucket . RUnlock ( ) if exists || create == false { return id } bucket . Lock ( ) defer bucket . Unlock ( ) id , exists = bucket . lookup [ s ] if exists { return id } id = bucket . counter bucket . lookup [ s ] = id bucket . counter += m . jump return id }
Get the id for the given string,
optionally creating one if it doesn't exist
Get the id for the given string optionally creating one if it doesn ' t exist