clientv3: copy correct pointers into txn comparisons

Was copying the range variable's pointer; all elements of cmp were the same.
This commit is contained in:
Anthony Romano 2016-02-20 22:01:33 -08:00
parent c3824b10da
commit 7b82576b60

View File

@ -85,8 +85,8 @@ func (txn *txn) If(cs ...Cmp) Txn {
txn.cif = true
for _, cmp := range cs {
txn.cmps = append(txn.cmps, (*pb.Compare)(&cmp))
for i := range cs {
txn.cmps = append(txn.cmps, (*pb.Compare)(&cs[i]))
}
return txn