Code optimization and logic refactoring

pull/909/head
chen.ma 3 years ago
parent dc9c36691e
commit 322b9b8aa1

@ -79,7 +79,7 @@ public class DefaultPublisher extends Thread implements EventPublisher {
private void openEventHandler() { private void openEventHandler() {
try { try {
int waitTimes = 60; int waitTimes = 60;
for (; ; ) { for (;;) {
if (shutdown || hasSubscriber() || waitTimes <= 0) { if (shutdown || hasSubscriber() || waitTimes <= 0) {
break; break;
} }
@ -90,7 +90,7 @@ public class DefaultPublisher extends Thread implements EventPublisher {
} }
waitTimes--; waitTimes--;
} }
for (; ; ) { for (;;) {
if (shutdown) { if (shutdown) {
break; break;
} }

@ -105,7 +105,7 @@ public class LongPollingService {
@Override @Override
public void run() { public void run() {
try { try {
for (Iterator<ClientLongPolling> iter = allSubs.iterator(); iter.hasNext(); ) { for (Iterator<ClientLongPolling> iter = allSubs.iterator(); iter.hasNext();) {
ClientLongPolling clientSub = iter.next(); ClientLongPolling clientSub = iter.next();
String identity = groupKey + GROUP_KEY_DELIMITER + identify; String identity = groupKey + GROUP_KEY_DELIMITER + identify;
List<String> parseMapForFilter = CollectionUtil.newArrayList(identity); List<String> parseMapForFilter = CollectionUtil.newArrayList(identity);

Loading…
Cancel
Save