]> OCCT Git - occt.git/commitdiff
0033671: Coding - GeomTools performance update CR33671
authordpasukhi <dmitry.pasukhin@opencascade.com>
Sun, 14 Apr 2024 10:12:01 +0000 (10:12 +0000)
committerdpasukhi <dmitry.pasukhin@opencascade.com>
Sat, 1 Jun 2024 12:15:40 +0000 (12:15 +0000)
Update size of buffer for the brep parsing according standard

src/GeomTools/GeomTools.cxx

index 767fa178a2f8b2a6cc00be1216c06c608513ac8c..a94c6ab2eb19d8ad29b365d0886d795b337ca629 100644 (file)
@@ -101,10 +101,11 @@ void GeomTools::GetReal(Standard_IStream& IS,Standard_Real& theValue)
   theValue = 0.;
   if (IS.eof()) 
     return;
-
-  char buffer[256];
+  // According IEEE-754 Specification and standard stream parameters
+  // the most optimal buffer length is 25
+  char buffer[25];
   buffer[0] = '\0';
-  std::streamsize anOldWide = IS.width(256);
+  std::streamsize anOldWide = IS.width(25);
   IS >> buffer;
   IS.width(anOldWide);
   theValue = Strtod(buffer, NULL);