Skip to content

Commit

Permalink
Simplify Delete method in ItemList.
Browse files Browse the repository at this point in the history
  • Loading branch information
PureUsagi committed Mar 12, 2024
1 parent 15ab9d7 commit 292f6be
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/seedu/binbash/ItemList.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public void addItem(Item item) {
}

public String deleteItem(int index) {
Item tempItem = itemList.get(index - 1);
itemList.remove(index - 1);
Item tempItem = itemList.remove(index - 1);

String output = "Got it! I've removed the following item:"
+ String.format("\t%s", tempItem);
Expand Down

0 comments on commit 292f6be

Please sign in to comment.