Skip to content

Commit d50da48

Browse files
committed
minor optimization
1 parent 1040abb commit d50da48

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

ParseLiveQuery/src/main/java/com/parse/ParseLiveQueryClientImpl.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,19 @@
5353

5454
private static URI getDefaultUri() {
5555
URL serverUrl = ParseRESTCommand.server;
56-
if (serverUrl != null) {
57-
String url = serverUrl.toString();
58-
if (serverUrl.getProtocol().equals("https")) {
59-
url = url.replaceFirst("https", "wss");
60-
} else {
61-
url = url.replaceFirst("http", "ws");
62-
}
63-
try {
64-
return new URI(url);
65-
} catch (URISyntaxException e) {
66-
e.printStackTrace();
67-
throw new RuntimeException(e.getMessage());
68-
}
56+
if (serverUrl == null) return null;
57+
String url = serverUrl.toString();
58+
if (serverUrl.getProtocol().equals("https")) {
59+
url = url.replaceFirst("https", "wss");
60+
} else {
61+
url = url.replaceFirst("http", "ws");
62+
}
63+
try {
64+
return new URI(url);
65+
} catch (URISyntaxException e) {
66+
e.printStackTrace();
67+
throw new RuntimeException(e.getMessage());
6968
}
70-
return null;
7169
}
7270

7371
@Override

0 commit comments

Comments
 (0)