tweak instruction collector

This commit is contained in:
Quaternions 2025-01-18 05:22:02 -08:00
parent 75c8bc2bbb
commit 77db5a7a6b
2 changed files with 5 additions and 3 deletions

View File

@ -62,6 +62,7 @@ impl<I,T> InstructionCollector<I,T>
pub const fn time(&self)->Time<T>{
self.time
}
#[inline]
pub fn collect(&mut self,instruction:Option<TimedInstruction<I,T>>){
if let Some(ins)=instruction{
if ins.time<self.time{
@ -70,7 +71,8 @@ impl<I,T> InstructionCollector<I,T>
}
}
}
pub fn instruction(self)->Option<TimedInstruction<I,T>>{
#[inline]
pub fn take(self)->Option<TimedInstruction<I,T>>{
//STEAL INSTRUCTION AND DESTROY INSTRUCTIONCOLLECTOR
self.instruction.map(|instruction|TimedInstruction{
time:self.time,

View File

@ -1145,7 +1145,7 @@ impl PhysicsData{
)
);
});
collector.instruction()
collector.take()
}