improve seek algorithmic complexity O(n) -> O(log(n))

This commit is contained in:
2026-02-27 07:05:23 -08:00
parent c3cca22839
commit 197f840246
7 changed files with 73 additions and 34 deletions

View File

@@ -134,10 +134,10 @@ impl PlaybackHead{
}
/// Set the playback head position to new_time.
#[wasm_bindgen]
pub fn set_head_time(&mut self,time:f64,new_time:f64){
pub fn set_head_time(&mut self,bot:&CompleteBot,time:f64,new_time:f64){
let time=time::from_float(time).unwrap();
let new_time=time::from_float(new_time).unwrap();
self.head.set_time(time,new_time);
self.head.set_time(&bot.bot,time,new_time);
}
#[wasm_bindgen]
pub fn get_run_time(&self,bot:&CompleteBot,time:f64,mode_id:u32)->Option<f64>{