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) {
|
||||
String[] parts = name.split(" ");
|
||||
if (parts.length <= 1) {
|
||||
return name;
|
||||
} else {
|
||||
if (Character.isDigit(parts[parts.length -1].charAt(0))) {
|
||||
if (parts.length > 1 && Character.isDigit(parts[parts.length -1].charAt(0))) {
|
||||
StringBuilder output = new StringBuilder();
|
||||
for(int i = 0; i < parts.length -1; ++i) {
|
||||
if (output.length() != 0) {
|
||||
|
@ -146,5 +143,4 @@ public class Presences {
|
|||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue