fuyou001 commented on code in PR #10469:
URL: https://github.com/apache/rocketmq/pull/10469#discussion_r3393501425
##########
common/src/main/java/org/apache/rocketmq/common/message/MessageVersion.java:
##########
@@ -71,12 +71,12 @@ public void putTopicLength(ByteBuffer buffer, int
topicLength) {
}
public static MessageVersion valueOfMagicCode(int magicCode) {
- for (MessageVersion version : MessageVersion.values()) {
- if (version.getMagicCode() == magicCode) {
- return version;
- }
+ if (magicCode == MessageDecoder.MESSAGE_MAGIC_CODE) {
Review Comment:
replace if with switch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]