Skip to content

Commit 7c90789

Browse files
SougandhSmerks
authored andcommitted
Optimise code in Copy Expression
Remove redundant return and additional empty string calculation
1 parent 48d7314 commit 7c90789

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/CopyExpressionsToClipboardActionDelegate.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,12 @@ protected String exludeLabels(Object itemData, String label) {
4949
if (label.equals(DebugUIMessages.DefaultLabelProvider_15)) {
5050
return null;
5151
}
52-
if (label.contains(DebugUIMessages.DefaultLabelProvider_15)) {
53-
int index = label.lastIndexOf(DebugUIMessages.DefaultLabelProvider_15);
54-
if (index != -1) {
55-
label = label.substring(0, index)
56-
+ label.substring(index + DebugUIMessages.DefaultLabelProvider_15.length());
57-
}
52+
int index = label.lastIndexOf(DebugUIMessages.DefaultLabelProvider_15);
53+
if (index != -1) {
54+
label = label.substring(0, index);
5855
}
5956
}
60-
return label;
6157
}
6258
return label;
6359
}
64-
65-
6660
}

0 commit comments

Comments
 (0)