Skip to content

Conversation

@zhyzhyzhy
Copy link

感觉冗余代码有点多。。。
这里把构造函数中的代码放到init中,同时禁止init被调用两次
去掉peerMap的get方法,外界不应该接触到peerMap

@@ -0,0 +1,13 @@
package com.github.wenweihu86.raft;

public class PeerId {
Copy link
Owner

Choose a reason for hiding this comment

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

PeerId作为map的key时,应该实现equals和hashcode函数。

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.

2 participants