func (z *zset) Rem(member string) { if score, ok := z.tbl[member]; ok { var obj C.slobj obj.ptr, obj.length = tocstring(member) C.slDelete(z.sl, C.double(score), &obj) delete(z.tbl, member) } }
func (z *zset) Add(score float64, member string) { if old, ok := z.tbl[member]; ok { if old == score { return } var obj C.slobj obj.ptr, obj.length = tocstring(member) C.slDelete(z.sl, C.double(old), &obj) } C.slInsert(z.sl, C.double(score), newslobj(member)) z.tbl[member] = score }