-
Notifications
You must be signed in to change notification settings - Fork 319
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
code styles fix #233
code styles fix #233
Conversation
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.
Pretty detailed.
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.
@akkw May need to check how CI failed.
@@ -675,10 +675,14 @@ private void doTruncate(long truncateIndex) throws Exception { | |||
PreConditions.check(type.get() == PushEntryRequest.Type.TRUNCATE, DLedgerResponseCode.UNKNOWN); | |||
DLedgerEntry truncateEntry = dLedgerStore.get(truncateIndex); | |||
PreConditions.check(truncateEntry != null, DLedgerResponseCode.UNKNOWN); | |||
|
|||
assert truncateEntry != null; |
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.
Why should we check again here?
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.
这里可能是我处理太快,没有看到上面的校验
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.
Why should we check again here?
我继续检查一下其他代码
@@ -419,20 +419,20 @@ public EntryDispatcher(String peerId, Logger logger) { | |||
|
|||
private boolean checkAndFreshState() { |
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.
This is mainly to check whether it is the master, so I think the original logic is more smooth
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.
总觉得非操作会使逻辑计算变得复杂,这里换一个方法名可以吗?把不为master体现出来
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.
总觉得非操作会使逻辑计算变得复杂,这里换一个方法名可以吗?把不为master体现出来
可以的哈
处理了代码里面明显的警告