Skip to content

Commit fa75f32

Browse files
committed
Avoid unnecessary operation in Device::integrate with two integration.
1 parent 501d3c5 commit fa75f32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ void Device::integrate( const double & dt )
419419

420420
if (controlInputType_==CONTROL_INPUT_TWO_INTEGRATION)
421421
{
422+
if(controlIN.size() == velocity_.size()) offset = 0;
422423
for( int i=0;i<controlIN.size();++i )
423424
{
424-
if(controlIN.size() == velocity_.size()) offset = 0;
425425
vel_control_(i) = velocity_(i+offset) + controlIN(i)*dt*0.5;
426426
velocity_(i+offset) = velocity_(i+offset) + controlIN(i)*dt;
427427
}

0 commit comments

Comments
 (0)