-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TXM In-memory: step 3-01-SaveSentAttempt #12224
TXM In-memory: step 3-01-SaveSentAttempt #12224
Conversation
I see that you haven't updated any README files. Would it make sense to do so? |
common/txmgr/inmemory_store.go
Outdated
for i := range tx.TxAttempts { | ||
if tx.TxAttempts[i].ID == attempt.ID { | ||
tx.TxAttempts[i].State = txmgrtypes.TxAttemptBroadcast | ||
return | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Can avoid indexing
for i := range tx.TxAttempts { | |
if tx.TxAttempts[i].ID == attempt.ID { | |
tx.TxAttempts[i].State = txmgrtypes.TxAttemptBroadcast | |
return | |
} | |
} | |
for _, txAttempt := range tx.TxAttempts { | |
if txAttempt.ID == attempt.ID { | |
txAttempt.State = txmgrtypes.TxAttemptBroadcast | |
return | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great find! will switch to the for i :=0; i < _ ; i++
syntax to prevent the linter from complaining :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, looks good though
Quality Gate passedIssues Measures |
NOTES:
Parent: