Skip to content

Commit

Permalink
refactor: remove 'tigger' 🐅
Browse files Browse the repository at this point in the history
拼写错误...
  • Loading branch information
shadow3aaa committed Oct 10, 2024
1 parent 8263706 commit 0738a12
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions src/cpu_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ impl Controller {

pub fn init_game(&mut self, extension: &Extension) {
self.policy_freq = self.max_freq;
extension.tigger_extentions(ApiV0::InitCpuFreq);
extension.tigger_extentions(ApiV1::InitCpuFreq);
extension.tigger_extentions(ApiV2::InitCpuFreq);
extension.trigger_extentions(ApiV0::InitCpuFreq);
extension.trigger_extentions(ApiV1::InitCpuFreq);
extension.trigger_extentions(ApiV2::InitCpuFreq);

for cpu in &self.cpu_infos {
cpu.write_freq(self.max_freq, &mut self.file_handler)
Expand All @@ -108,9 +108,9 @@ impl Controller {

pub fn init_default(&mut self, extension: &Extension) {
self.policy_freq = self.max_freq;
extension.tigger_extentions(ApiV0::ResetCpuFreq);
extension.tigger_extentions(ApiV1::ResetCpuFreq);
extension.tigger_extentions(ApiV2::ResetCpuFreq);
extension.trigger_extentions(ApiV0::ResetCpuFreq);
extension.trigger_extentions(ApiV1::ResetCpuFreq);
extension.trigger_extentions(ApiV2::ResetCpuFreq);

for cpu in &mut self.cpu_infos {
cpu.reset_freq(&mut self.file_handler)
Expand Down
2 changes: 1 addition & 1 deletion src/framework/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Extension {
Ok(Self { sx })
}

pub fn tigger_extentions(&self, trigger: impl Api + 'static) {
pub fn trigger_extentions(&self, trigger: impl Api + 'static) {
let _ = self.sx.try_send(trigger.into_box());
}
}
2 changes: 1 addition & 1 deletion src/framework/scheduler/looper/buffer/calculate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Buffer {
let new_target_fps = self.target_fps();
if self.target_fps != new_target_fps {
if let Some(target_fps) = new_target_fps {
extension.tigger_extentions(ApiV2::TargetFpsChange(target_fps, self.pkg.clone()));
extension.trigger_extentions(ApiV2::TargetFpsChange(target_fps, self.pkg.clone()));
}

self.target_fps = new_target_fps;
Expand Down
24 changes: 12 additions & 12 deletions src/framework/scheduler/looper/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ impl Looper {
self.database = open_database().unwrap();
}
self.extension
.tigger_extentions(ApiV0::UnloadFas(buffer.pid, pkg.clone()));
.trigger_extentions(ApiV0::UnloadFas(buffer.pid, pkg.clone()));
self.extension
.tigger_extentions(ApiV1::UnloadFas(buffer.pid, pkg.clone()));
.trigger_extentions(ApiV1::UnloadFas(buffer.pid, pkg.clone()));
self.extension
.tigger_extentions(ApiV2::UnloadFas(buffer.pid, pkg));
.trigger_extentions(ApiV2::UnloadFas(buffer.pid, pkg));
self.buffer = None;
}
}
Expand All @@ -66,9 +66,9 @@ impl Looper {
self.state = State::NotWorking;
self.cleaner.undo_cleanup();
self.controller.init_default(&self.extension);
self.extension.tigger_extentions(ApiV0::StopFas);
self.extension.tigger_extentions(ApiV1::StopFas);
self.extension.tigger_extentions(ApiV2::StopFas);
self.extension.trigger_extentions(ApiV0::StopFas);
self.extension.trigger_extentions(ApiV1::StopFas);
self.extension.trigger_extentions(ApiV2::StopFas);
}
State::Waiting => self.state = State::NotWorking,
State::NotWorking => (),
Expand All @@ -80,9 +80,9 @@ impl Looper {
State::NotWorking => {
self.state = State::Waiting;
self.delay_timer = Instant::now();
self.extension.tigger_extentions(ApiV0::StartFas);
self.extension.tigger_extentions(ApiV1::StartFas);
self.extension.tigger_extentions(ApiV2::StartFas);
self.extension.trigger_extentions(ApiV0::StartFas);
self.extension.trigger_extentions(ApiV1::StartFas);
self.extension.trigger_extentions(ApiV2::StartFas);
}
State::Waiting => {
if self.delay_timer.elapsed() > DELAY_TIME {
Expand Down Expand Up @@ -122,11 +122,11 @@ impl Looper {
self.fitness = f64::MIN;

self.extension
.tigger_extentions(ApiV0::LoadFas(pid, pkg.clone()));
.trigger_extentions(ApiV0::LoadFas(pid, pkg.clone()));
self.extension
.tigger_extentions(ApiV1::LoadFas(pid, pkg.clone()));
.trigger_extentions(ApiV1::LoadFas(pid, pkg.clone()));
self.extension
.tigger_extentions(ApiV2::LoadFas(pid, pkg.clone()));
.trigger_extentions(ApiV2::LoadFas(pid, pkg.clone()));

let mut buffer = Buffer::new(target_fps, pid, pkg);
buffer.push_frametime(frametime, &self.extension);
Expand Down

1 comment on commit 0738a12

@DdogezD
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xD

Please sign in to comment.