Clean up RaftActorBehaviour.canGrantVote() 10/115010/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 29 Jan 2025 21:10:55 +0000 (22:10 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 29 Jan 2025 21:13:30 +0000 (22:13 +0100)
commit7a9dae9499a7a0fd22451d6baa6ccaac31a125d7
treee698ea1c67701166e86dce7a26e9781f26b33d32
parentd19f3096bd975320c0b24c838c78eb6156c40eef
Clean up RaftActorBehaviour.canGrantVote()

We are using state variable and if/else blocks to change its initial
value. Rather than doing that, let's just return the appopriate result
as soon as we know it.

While we are here, store values we access multiple times in local
variables for brevity and simplicity.

Change-Id: I2c8eb29d617bf41d0451ae42d31b30e8f959774e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java