improved performance
This commit is contained in:
parent
78d59a9935
commit
265e4181b7
@ -347,7 +347,8 @@ public class DefaultTbLocalSubscriptionService implements TbLocalSubscriptionSer
|
||||
if (sub.isAllKeys()) {
|
||||
if (sub.isLatestValues()) {
|
||||
for (TsKvEntry kv : data) {
|
||||
if (!keyStates.containsKey((kv.getKey())) || kv.getTs() > keyStates.get(kv.getKey())) {
|
||||
Long stateTs = keyStates.get(kv.getKey());
|
||||
if (stateTs == null || kv.getTs() > stateTs) {
|
||||
if (updateData == null) {
|
||||
updateData = new ArrayList<>();
|
||||
}
|
||||
@ -359,8 +360,9 @@ public class DefaultTbLocalSubscriptionService implements TbLocalSubscriptionSer
|
||||
}
|
||||
} else {
|
||||
for (TsKvEntry kv : data) {
|
||||
if (keyStates.containsKey((kv.getKey()))) {
|
||||
if (!sub.isLatestValues() || kv.getTs() > keyStates.get(kv.getKey())) {
|
||||
Long stateTs = keyStates.get(kv.getKey());
|
||||
if (stateTs != null) {
|
||||
if (!sub.isLatestValues() || kv.getTs() > stateTs) {
|
||||
if (updateData == null) {
|
||||
updateData = new ArrayList<>();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user