From: Kevin M. Rosenberg Date: Sun, 5 Oct 2003 17:23:18 +0000 (+0000) Subject: r7950: minor efficiency change X-Git-Tag: debian-4.5.3-3~53 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=87ee1eb8f451d1f1b278c160e5f90ff20301560c r7950: minor efficiency change --- diff --git a/libctsim/backprojectors.cpp b/libctsim/backprojectors.cpp index 581b7ff..ef1ef12 100644 --- a/libctsim/backprojectors.cpp +++ b/libctsim/backprojectors.cpp @@ -631,10 +631,10 @@ BackprojectIntDiff::BackprojectView (const double* const filteredProj, const dou } else if (interpType == Backprojector::INTERP_LINEAR) { for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) { const long iDetPos = curDetPos >> scaleShift; - const long detRemainder = curDetPos & scaleBitmask; - if (iDetPos >= 0 && iDetPos <= iLastDet) - *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]); - + if (iDetPos >= 0 && iDetPos <= iLastDet) { + const long detRemainder = curDetPos & scaleBitmask; + *pImCol++ += filteredProj[iDetPos] + (detRemainder * deltaFilteredProj[iDetPos]); + } } // end for iy } else if (interpType == Backprojector::INTERP_CUBIC) { for (int iy = 0; iy < ny; iy++, curDetPos += det_dy) {