mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
Coding - GeomTools performance update #19
Update size of buffer for the brep parsing according standard
This commit is contained in:
parent
819ae9a55f
commit
4bda7ebe40
@ -100,12 +100,17 @@ void GeomTools::GetReal(Standard_IStream& IS,Standard_Real& theValue)
|
|||||||
{
|
{
|
||||||
theValue = 0.;
|
theValue = 0.;
|
||||||
if (IS.eof())
|
if (IS.eof())
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
char buffer[256];
|
// According IEEE-754 Specification and standard stream parameters
|
||||||
buffer[0] = '\0';
|
// the most optimal buffer length not less then 25
|
||||||
std::streamsize anOldWide = IS.width(256);
|
constexpr size_t THE_BUFFER_SIZE = 32;
|
||||||
IS >> buffer;
|
char aBuffer[THE_BUFFER_SIZE];
|
||||||
IS.width(anOldWide);
|
|
||||||
theValue = Strtod(buffer, NULL);
|
aBuffer[0] = '\0';
|
||||||
|
std::streamsize anOldWide = IS.width(THE_BUFFER_SIZE - 1);
|
||||||
|
IS >> aBuffer;
|
||||||
|
IS.width(anOldWide);
|
||||||
|
theValue = Strtod(aBuffer, nullptr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user