Skip to content

Commit 96a6ece

Browse files
committed
Refactor ReadPoint to simplify coordinate reading using range-based for loop
1 parent 320ca20 commit 96a6ece

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kratos/input_output/stl_io.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,8 @@ void StlIO::ReadLoop(
458458

459459
void StlIO::ReadPoint(std::array<double, 3>& rCoordinates)
460460
{
461-
std::string word;
462-
for(int i = 0 ; i < 3 ; i++){
463-
*mpInputStream >> word;
464-
rCoordinates[i] = std::stod(word);
461+
for (double& r_coordinate : rCoordinates) {
462+
*mpInputStream >> r_coordinate;
465463
}
466464
}
467465

0 commit comments

Comments
 (0)