This looks semantically equivalent to me. If r > 0, and is complete, we fill in the final transaction and we set the offset (if it's not complete we short-circuited before reaching these changes). No matter what, we set the return value. What does your change accomplish?