Skip to content

Commit

Permalink
Coding - ASCII BRep double reading using stream #214
Browse files Browse the repository at this point in the history
Simplify GetReal function by removing unnecessary buffer handling
  • Loading branch information
dpasukhi committed Dec 27, 2024
1 parent 1b4bb62 commit e0c3ca6
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/GeomTools/GeomTools.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,5 @@ Handle(GeomTools_UndefinedTypeHandler) GeomTools::GetUndefinedTypeHandler()

void GeomTools::GetReal(Standard_IStream& IS, Standard_Real& theValue)
{
theValue = 0.;
if (IS.eof())
{
return;
}
// According IEEE-754 Specification and standard stream parameters
// the most optimal buffer length not less then 25
constexpr size_t THE_BUFFER_SIZE = 32;
char aBuffer[THE_BUFFER_SIZE];

aBuffer[0] = '\0';
std::streamsize anOldWide = IS.width(THE_BUFFER_SIZE - 1);
IS >> aBuffer;
IS.width(anOldWide);
theValue = Strtod(aBuffer, nullptr);
IS >> theValue;
}

0 comments on commit e0c3ca6

Please sign in to comment.