Skip to content

Commit 4f8b93d

Browse files
committed
refact: minor cleanup
1 parent 7d46777 commit 4f8b93d

File tree

1 file changed

+2
-8
lines changed
  • org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/utils

1 file changed

+2
-8
lines changed

org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/utils/ScopeNames.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ public final class ScopeNames {
2323

2424
public static @Nullable String getContributor(final String scopeName) {
2525
final int separatorAt = scopeName.indexOf(CONTRIBUTOR_SEPARATOR);
26-
if (separatorAt == -1) {
27-
return "";
28-
}
29-
return scopeName.substring(separatorAt + 1);
26+
return separatorAt == -1 ? null : scopeName.substring(separatorAt + 1);
3027
}
3128

3229
/**
@@ -38,10 +35,7 @@ public static boolean hasContributor(final String scopeName) {
3835

3936
public static String withoutContributor(final String scopeName) {
4037
final int separatorAt = scopeName.indexOf(CONTRIBUTOR_SEPARATOR);
41-
if (separatorAt == -1) {
42-
return scopeName;
43-
}
44-
return scopeName.substring(0, separatorAt);
38+
return separatorAt == -1 ? scopeName : scopeName.substring(0, separatorAt);
4539
}
4640

4741
private ScopeNames() {

0 commit comments

Comments
 (0)