Skip to content

Commit

Permalink
Remove unused import, improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
btbrandon committed Nov 10, 2024
1 parent cd2869f commit 100f2e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/commands/DeleteCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public CommandResult execute(Model model) throws CommandException {
requireNonNull(model);
List<Person> lastShownList = model.getFilteredPersonList();
Person toDelete = null;
boolean PersonDetailsDeleted = false;
boolean personDetailsDeleted = false;

for (Person person : lastShownList) {
if (person.getStudentId().equals(studentId)) {
Expand Down Expand Up @@ -112,11 +112,11 @@ public CommandResult execute(Model model) throws CommandException {

if (toDelete.isSamePerson(model.getPersonToDisplay())) {
model.setPersonToDisplay(null);
PersonDetailsDeleted = true;
personDetailsDeleted = true;
}

model.deletePerson(toDelete);
if (PersonDetailsDeleted) {
if (personDetailsDeleted) {
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, Messages.format(toDelete)), true);
}
return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, Messages.format(toDelete)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import seedu.address.logic.commands.EditCommand;
import seedu.address.logic.commands.EditCommand.EditPersonDescriptor;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Email;
import seedu.address.model.person.Module;
import seedu.address.model.person.StudentId;

Expand Down

0 comments on commit 100f2e9

Please sign in to comment.