code: func (w *weightedRandomSelect) setWeight(item wrsItem, weight int64) {
  	idx, ok := w.idx[item]
  	if ok {
  		w.root.setWeight(idx, weight)
  		if weight == 0 {
  			delete(w.idx, item)
  		}
  	} else {
  		if weight != 0 {
  			if w.root.itemCnt == w.root.maxItems {
  				// add a new level
  				newRoot := &wrsNode{sumWeight: w.root.sumWeight, itemCnt: w.root.itemCnt, level: w.root.level + 1, maxItems: w.root.maxItems * wrsBranches}
  				newRoot.items[0] = w.root
  				newRoot.weights[0] = w.root.sumWeight
  				w.root = newRoot
  			}
  			w.idx[item] = w.root.insert(item, weight)
  		}
  	}
  }
docs: // setWeight sets an item's weight to a specific value (removes it if zero)