Skip to content

Commit

Permalink
simplify loops
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon committed Oct 4, 2023
1 parent cf756ba commit ec23411
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,8 @@ public void close() {
}
}

for (int positionIndex = 0; positionIndex < (acqSettings_.isUsingMultiplePositions() ?
pl.getNumberOfPositions() : 1); positionIndex++) {
final int numPositions = acqSettings_.isUsingMultiplePositions() ? pl.getNumberOfPositions() : 1;
for (int positionIndex = 0; positionIndex < numPositions; positionIndex++) {
AcquisitionEvent baseEvent = new AcquisitionEvent(currentAcquisition_);
if (acqSettings_.isUsingMultiplePositions()) {
baseEvent.setAxisPosition(LSMAcquisitionEvents.POSITION_AXIS, positionIndex);
Expand All @@ -1371,8 +1371,8 @@ public void close() {
}
} else {
// Loop 2: Multiple time points
for (int timeIndex = 0; timeIndex < (acqSettings_.isUsingTimePoints() ?
acqSettings_.numTimePoints() : 1); timeIndex++) {
final int numTimePoints = acqSettings_.isUsingTimePoints() ? acqSettings_.numTimePoints() : 1;
for (int timeIndex = 0; timeIndex < numTimePoints; timeIndex++) {
baseEvent.setTimeIndex(timeIndex);
// Loop 3: Channels; Loop 4: Z slices (non-interleaved)
// Loop 3: Channels; Loop 4: Z slices (interleaved)
Expand Down

0 comments on commit ec23411

Please sign in to comment.