Compacting code a little bit
This commit is contained in:
parent
e0457c2ad8
commit
5955e1c823
1 changed files with 3 additions and 7 deletions
|
@ -14,6 +14,7 @@ import com.google.gson.reflect.TypeToken;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -118,16 +119,11 @@ public class NetworkService extends Service {
|
||||||
|
|
||||||
// Deciding whether to use an externally provided list of node URLs, or use our internal one
|
// Deciding whether to use an externally provided list of node URLs, or use our internal one
|
||||||
if(serializedNodeUrls.equals("")){
|
if(serializedNodeUrls.equals("")){
|
||||||
for(int i = 0; i < Nodes.NODE_URLS.length; i++){
|
mNodeUrls.addAll(Arrays.asList(Nodes.NODE_URLS));
|
||||||
mNodeUrls.add(Nodes.NODE_URLS[i]);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
String[] urls = serializedNodeUrls.split(",");
|
String[] urls = serializedNodeUrls.split(",");
|
||||||
for(String url : urls){
|
mNodeUrls.addAll(Arrays.asList(urls));
|
||||||
mNodeUrls.add(url);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
connect();
|
connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue