Skip to content

Commit 74f29c2

Browse files
committed
Small refactoring
1 parent c00c062 commit 74f29c2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/com/hivemq/client/internal/mqtt/datatypes/MqttTopicIterator.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,12 @@ public boolean hasMultiLevelWildcard() {
9999
return new MqttTopicLevels(Arrays.copyOfRange(array, start, allEnd), end - start);
100100
}
101101

102-
public boolean forwardIfEqual(final @NotNull MqttTopicLevels topicLevels) {
103-
final byte[] topicLevelsArray = topicLevels.getArray();
104-
final int topicLevelsEnd = topicLevels.getEnd();
105-
final int to = end + topicLevelsArray.length - topicLevelsEnd;
102+
public boolean forwardIfEqual(final @NotNull MqttTopicLevels levels) {
103+
final byte[] levelsArray = levels.getArray();
104+
final int levelsEnd = levels.getEnd();
105+
final int to = end + levelsArray.length - levelsEnd;
106106
if ((to <= allEnd) && ((to == allEnd) || (array[to] == MqttTopic.TOPIC_LEVEL_SEPARATOR)) &&
107-
ByteArrayUtil.equals(array, end + 1, to, topicLevelsArray, topicLevelsEnd + 1,
108-
topicLevelsArray.length)) {
107+
ByteArrayUtil.equals(array, end + 1, to, levelsArray, levelsEnd + 1, levelsArray.length)) {
109108
start = end = to;
110109
return true;
111110
}

0 commit comments

Comments
 (0)