// Create a new id mapper. For greater throughput, values are internally
// sharded into X buckets, where buckets must be a power of 2
Create a new id mapper. For greater throughput, values are internally
sharded into X buckets, where buckets must be a power of 2
// Create a new id mapper . For greater throughput values are internally // sharded into X buckets where buckets must be a power of 2
func New32(buckets int) *Map32 {
	if buckets == 0 || ((buckets&(^buckets+1)) == buckets) == false {
		buckets = 16
	}
	b := uint32(buckets)
	m := &Map32{
		bucketMask: b - 1,
		jump:       uint32(buckets),
		lookup:     make(map[uint32]*Bucket32, buckets),
	}
	for i := uint32(0); i < b; i++ {
		m.lookup[i] = &Bucket32{
			counter: uint32(i + 1),
			lookup:  make(map[string]uint32),
		}
	}
	return m
}
func New32 ( buckets int ) * Map32 { if buckets == 0 || ( ( buckets & ( ^ buckets + 1 ) ) == buckets ) == false { buckets = 16 } b := uint32 ( buckets ) m := & Map32 { bucketMask : b - 1 , jump : uint32 ( buckets ) , lookup : make ( map [ uint32 ] * Bucket32 , buckets ) , } for i := uint32 ( 0 ) ; i < b ; i ++ { m . lookup [ i ] = & Bucket32 { counter : uint32 ( i + 1 ) , lookup : make ( map [ string ] uint32 ) , } } return m }
Create a new id mapper.
Create a new id mapper .