Skip to content

Commit

Permalink
Use enhanced for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Dec 17, 2024
1 parent 71dbefb commit 0798e8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/main/java/hudson/plugins/ec2/EC2RetentionStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ private boolean itemsInQueueForThisSlave(EC2Computer c) {
}
final Label selfLabel = selfNode.getSelfLabel();
Queue.Item[] items = Jenkins.getInstance().getQueue().getItems();
for (int i = 0; i < items.length; i++) {
Queue.Item item = items[i];
for (Queue.Item item : items) {
final Label assignedLabel = item.getAssignedLabel();
if (assignedLabel == selfLabel) {
LOGGER.fine("Preventing idle timeout of " + c.getName()
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/hudson/plugins/ec2/Tenancy.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ public String toString() {

public static Tenancy fromValue(String value) {
if (value != null && !"".equals(value)) {
Tenancy[] var1 = values();
int var2 = var1.length;

for (int var3 = 0; var3 < var2; ++var3) {
Tenancy enumEntry = var1[var3];
for (Tenancy enumEntry : values()) {
if (enumEntry.toString().equals(value)) {
return enumEntry;
}
Expand Down

0 comments on commit 0798e8b

Please sign in to comment.