mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
perf: use Vec instead of BTreeMap in Phrase
This commit is contained in:
parent
db25099268
commit
4a8f5b267f
7 changed files with 150 additions and 221 deletions
|
|
@ -106,11 +106,9 @@ const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
|
|||
|
||||
[Char('x'), NONE, "extend", "double the current clip", |app: &mut App| {
|
||||
if let Some(phrase) = app.phrase_mut() {
|
||||
let mut notes = BTreeMap::new();
|
||||
for (time, events) in phrase.notes.iter() {
|
||||
notes.insert(time + phrase.length, events.clone());
|
||||
}
|
||||
phrase.notes.append(&mut notes);
|
||||
let mut notes = phrase.notes.clone();
|
||||
notes.extend_from_slice(&mut phrase.notes);
|
||||
phrase.notes = notes;
|
||||
phrase.length = phrase.length * 2;
|
||||
}
|
||||
Ok(true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue