cleanup nameWithoutVersion() code
This commit is contained in:
parent
5fd4169720
commit
d24022d755
|
@ -130,10 +130,7 @@ public class Presences {
|
||||||
|
|
||||||
private static String nameWithoutVersion(String name) {
|
private static String nameWithoutVersion(String name) {
|
||||||
String[] parts = name.split(" ");
|
String[] parts = name.split(" ");
|
||||||
if (parts.length <= 1) {
|
if (parts.length > 1 && Character.isDigit(parts[parts.length -1].charAt(0))) {
|
||||||
return name;
|
|
||||||
} else {
|
|
||||||
if (Character.isDigit(parts[parts.length -1].charAt(0))) {
|
|
||||||
StringBuilder output = new StringBuilder();
|
StringBuilder output = new StringBuilder();
|
||||||
for(int i = 0; i < parts.length -1; ++i) {
|
for(int i = 0; i < parts.length -1; ++i) {
|
||||||
if (output.length() != 0) {
|
if (output.length() != 0) {
|
||||||
|
@ -146,5 +143,4 @@ public class Presences {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue