tests: Optimize checking failed writes
@@ -101,13 +101,12 @@ func step(state EtcdState, request etcdRequest, response etcdResponse) (bool, Et
if state.Value == response.getData {
return true, state
}
- for write := range state.FailedWrites {
- if write == response.getData {
+ _, ok := state.FailedWrites[response.getData]
+ if ok {
state.Value = response.getData
- delete(state.FailedWrites, write)
+ delete(state.FailedWrites, response.getData)
return true, state
}
- }
case Put:
if response.err == nil {
state.Value = request.putData
