Skip to content
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

Merged
merged 5 commits into from
Oct 6, 2022
Merged

code styles fix #233

merged 5 commits into from
Oct 6, 2022

Conversation

akkw
Copy link
Contributor

@akkw akkw commented Sep 14, 2022

处理了代码里面明显的警告

Copy link
Contributor

@tsunghanjacktsai tsunghanjacktsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty detailed.

@tsunghanjacktsai tsunghanjacktsai self-requested a review September 15, 2022 02:02
Copy link
Contributor

@tsunghanjacktsai tsunghanjacktsai left a 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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可能是我处理太快,没有看到上面的校验

Copy link
Contributor Author

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() {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

总觉得非操作会使逻辑计算变得复杂,这里换一个方法名可以吗?把不为master体现出来

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

总觉得非操作会使逻辑计算变得复杂,这里换一个方法名可以吗?把不为master体现出来

可以的哈

@RongtongJin RongtongJin merged commit 5398f6a into openmessaging:master Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants