mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add alternative STL ASCII parsers
- In addition to the traditional Flex-based parser, added a Ragel-based
parser and a handwritten one.
Some representative timings for reading 5874387 points (1958129 tris):
Flex Ragel Manual
5.2s 4.8s 6.7s total reading time
3.8s 3.4s 5.3s without point merging
This commit is contained in:
@ -222,17 +222,18 @@ inline String Foam::string::validate(const std::string& str)
|
||||
String out;
|
||||
out.resize(str.size());
|
||||
|
||||
size_type count = 0;
|
||||
size_type len = 0;
|
||||
for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
|
||||
{
|
||||
const char c = *iter;
|
||||
if (String::valid(c))
|
||||
{
|
||||
out[count++] = c;
|
||||
out[len] = c;
|
||||
++len;
|
||||
}
|
||||
}
|
||||
|
||||
out.resize(count);
|
||||
out.resize(len);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user