Skip to content

Commit

Permalink
スタイルもソートする
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Jan 21, 2024
1 parent 7d0aa00 commit 2b41763
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/voicevox_core/src/metas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ pub fn merge<'a>(metas: impl IntoIterator<Item = &'a SpeakerMeta>) -> Vec<Speake
)
})
.into_values()
.sorted_by_key(|SpeakerMeta { styles, .. }| {
styles.iter().map(|&StyleMeta { id, .. }| id).min()
.map(|mut speaker| {
speaker
.styles
.sort_unstable_by_key(|&StyleMeta { id, .. }| id);
speaker
})
.sorted_unstable_by_key(|SpeakerMeta { styles, .. }| {
styles.first().map(|&StyleMeta { id, .. }| id)
})
.collect()
}
Expand Down

0 comments on commit 2b41763

Please sign in to comment.