code: func (n *wrsNode) setWeight(idx int, weight int64) int64 {
  	if n.level == 0 {
  		oldWeight := n.weights[idx]
  		n.weights[idx] = weight
  		diff := weight - oldWeight
  		n.sumWeight += diff
  		if weight == 0 {
  			n.items[idx] = nil
  			n.itemCnt--
  		}
  		return diff
  	}
  	branchItems := n.maxItems / wrsBranches
  	branch := idx / branchItems
  	diff := n.items[branch].(*wrsNode).setWeight(idx-branch*branchItems, weight)
  	n.weights[branch] += diff
  	n.sumWeight += diff
  	if weight == 0 {
  		n.itemCnt--
  	}
  	return diff
  }
docs: // setWeight updates the weight of a certain item (which should exist) and returns
  // the change of the last weight value stored in the tree