[ https://issues.apache.org/jira/browse/ROCKETMQ-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16172726#comment-16172726 ]
ASF GitHub Bot commented on ROCKETMQ-273: ----------------------------------------- Github user vongosling commented on a diff in the pull request: https://github.com/apache/incubator-rocketmq/pull/150#discussion_r139873296 --- Diff: store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java --- @@ -1094,34 +1090,15 @@ private boolean checkInDiskByCommitOffset(long offsetPy, long maxOffsetPy) { } private boolean isTheBatchFull(int sizePy, int maxMsgNums, int bufferTotal, int messageTotal, boolean isInDisk) { - - if (0 == bufferTotal || 0 == messageTotal) { - return false; - } - - if (maxMsgNums <= messageTotal) { - return true; - } - - if (isInDisk) { - if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInDisk()) { - return true; - } - - if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInDisk() - 1) { - return true; - } - } else { - if ((bufferTotal + sizePy) > this.messageStoreConfig.getMaxTransferBytesOnMessageInMemory()) { - return true; - } - - if (messageTotal > this.messageStoreConfig.getMaxTransferCountOnMessageInMemory() - 1) { - return true; - } - } - - return false; + return (0 != bufferTotal && 0 != messageTotal) + &&( --- End diff -- Human readable problem > return an expression when a function has no write operations > ------------------------------------------------------------ > > Key: ROCKETMQ-273 > URL: https://issues.apache.org/jira/browse/ROCKETMQ-273 > Project: Apache RocketMQ > Issue Type: Improvement > Components: rocketmq-store > Affects Versions: 4.2.0-incubating > Reporter: wangkai > Assignee: yukon > Priority: Minor > Labels: Improvement > Fix For: 4.2.0-incubating > > Original Estimate: 2h > Remaining Estimate: 2h > > return an expression when a function has no write operations. -- This message was sent by Atlassian JIRA (v6.4.14#64029)