Skip to content

Commit

Permalink
Remove unnecessary process
Browse files Browse the repository at this point in the history
  • Loading branch information
lusingander committed Feb 11, 2025
1 parent b9135e5 commit ca28286
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/widget/commit_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,18 @@ impl<'a> CommitListState<'a> {
}

pub fn select_parent(&mut self) {
let target_commit = self.selected_commit_parent_hash().clone();
while target_commit.as_str() != self.selected_commit_hash().as_str() {
self.select_next();
if let Some(target_commit) = self.selected_commit_parent_hash().cloned() {
while target_commit.as_str() != self.selected_commit_hash().as_str() {
self.select_next();
}
}
}

pub fn selected_commit_parent_hash(&self) -> &CommitHash {
let selected_commit_hash = self.selected_commit_hash();

pub fn selected_commit_parent_hash(&self) -> Option<&CommitHash> {
self.commits[self.current_selected_index()]
.commit
.parent_commit_hashes
.first()
.unwrap_or(selected_commit_hash)
}

pub fn select_prev(&mut self) {
Expand Down

0 comments on commit ca28286

Please sign in to comment.