Skip to content

Commit

Permalink
Hopefully cleaned up issue of unreachable code path and of using type…
Browse files Browse the repository at this point in the history
… in "out" parameter since interface defines type.
  • Loading branch information
hayakawa16 committed Feb 22, 2024
1 parent 183b53c commit 8f73dac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Vts/MonteCarlo/Helpers/CylinderTissueRegionToolbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ public static bool RayIntersectInfiniteCylinder(Position p1, Position p2, bool o

return true;

default: // roots imaginary -> no intersection
return false;
} /* end switch */

/* bb-4ac>0 */
/* roots imaginary -> no intersection */
return false;
}
}
}
3 changes: 1 addition & 2 deletions src/Vts/MonteCarlo/Tissues/SingleInclusionTissue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ public override double GetDistanceToBoundary(Photon photon)
if ((regionIndex != _layerRegionIndexOfInclusion) && (regionIndex != _inclusionRegionIndex))
return base.GetDistanceToBoundary(photon);
// check if current track will hit the inclusion boundary, returning the correct distance
double distanceToBoundary;
if (_inclusionRegion.RayIntersectBoundary(photon, out distanceToBoundary))
if (_inclusionRegion.RayIntersectBoundary(photon, out var distanceToBoundary))
{
return distanceToBoundary;
}
Expand Down

0 comments on commit 8f73dac

Please sign in to comment.