Skip to content

Commit

Permalink
rename order to actual_index
Browse files Browse the repository at this point in the history
  • Loading branch information
Equim-chan committed Feb 24, 2024
1 parent 692b886 commit 72001be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/review/mortal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Entry {

shanten: i8,
at_furiten: bool,
order: usize,
actual_index: usize,
}

#[derive(Debug, Clone, Serialize)]
Expand Down Expand Up @@ -362,7 +362,7 @@ impl Reviewer<'_> {

// this sort is better to be stable
details.sort_by(|l, r| r.q_value.total_cmp(&l.q_value));
let order = details
let actual_index = details
.iter()
.enumerate()
.find(|(_, d)| match (d.label, actual_kan_label) {
Expand Down Expand Up @@ -404,7 +404,7 @@ impl Reviewer<'_> {
details,
shanten,
at_furiten,
order,
actual_index,
};
entries.push(entry);
}
Expand Down
4 changes: 2 additions & 2 deletions templates/report.tera
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@
{{- fluent(key = "turn-info-furiten") -}}
&nbsp;&nbsp;&nbsp;
{%- endif -%}
{%- if mark_red and entry.order > 0 -%}
{%- if mark_red and entry.actual_index > 0 -%}
<span class="order-loss">
#{{- entry.order + 1 -}}
#{{- entry.actual_index + 1 -}}
</span>/{{- entry.details | length -}}
{%- endif -%}
</span>
Expand Down

0 comments on commit 72001be

Please sign in to comment.