This is an automated email from the ASF dual-hosted git repository.
maoling pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 016ffd9 ZOOKEEPER-4300: Simplify assignment statements of boolean
016ffd9 is described below
commit 016ffd9a3ec2cb669071e881d677441314aa8bfd
Author: lan <[email protected]>
AuthorDate: Fri May 28 15:55:03 2021 +0800
ZOOKEEPER-4300: Simplify assignment statements of boolean
Author: lan <[email protected]>
Reviewers: maoling <[email protected]>
Closes #1700 from lanicc/ZOOKEEPER-4300
---
.../src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
index eed74a7..6a42417 100644
---
a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
+++
b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
@@ -2112,7 +2112,7 @@ public class ZooKeeperServer implements SessionExpirer,
ServerStats.Provider {
//check the Count Quota
if (checkCountQuota) {
long newCount = currentStats.getCount() + countDiff;
- boolean isCountHardLimit = limitStats.getCountHardLimit() > -1 ?
true : false;
+ boolean isCountHardLimit = limitStats.getCountHardLimit() > -1;
long countLimit = isCountHardLimit ?
limitStats.getCountHardLimit() : limitStats.getCount();
if (newCount > countLimit) {
@@ -2127,7 +2127,7 @@ public class ZooKeeperServer implements SessionExpirer,
ServerStats.Provider {
//check the Byte Quota
if (checkByteQuota) {
long newBytes = currentStats.getBytes() + bytesDiff;
- boolean isByteHardLimit = limitStats.getByteHardLimit() > -1 ?
true : false;
+ boolean isByteHardLimit = limitStats.getByteHardLimit() > -1;
long byteLimit = isByteHardLimit ? limitStats.getByteHardLimit() :
limitStats.getBytes();
if (newBytes > byteLimit) {
String msg = "Quota exceeded: " + lastPrefix + " [current
bytes=" + newBytes + ", " + (isByteHardLimit ? "hard" : "soft") + "ByteLimit="
+ byteLimit + "]";