tweak instruction collector
This commit is contained in:
parent
75c8bc2bbb
commit
77db5a7a6b
@ -62,6 +62,7 @@ impl<I,T> InstructionCollector<I,T>
|
|||||||
pub const fn time(&self)->Time<T>{
|
pub const fn time(&self)->Time<T>{
|
||||||
self.time
|
self.time
|
||||||
}
|
}
|
||||||
|
#[inline]
|
||||||
pub fn collect(&mut self,instruction:Option<TimedInstruction<I,T>>){
|
pub fn collect(&mut self,instruction:Option<TimedInstruction<I,T>>){
|
||||||
if let Some(ins)=instruction{
|
if let Some(ins)=instruction{
|
||||||
if ins.time<self.time{
|
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
|
//STEAL INSTRUCTION AND DESTROY INSTRUCTIONCOLLECTOR
|
||||||
self.instruction.map(|instruction|TimedInstruction{
|
self.instruction.map(|instruction|TimedInstruction{
|
||||||
time:self.time,
|
time:self.time,
|
||||||
|
@ -1145,7 +1145,7 @@ impl PhysicsData{
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
collector.instruction()
|
collector.take()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user