Fixed a bug in FastCharSearch.
Reader buffer is now manually allocated, decreasing GC workload even further.
This commit is contained in:
parent
97bdf819fa
commit
8b995e5061
3 changed files with 38 additions and 22 deletions
|
@ -81,22 +81,16 @@ string searchCode(dstring chars, uint tableSize)()
|
|||
|
||||
if(tableSize)
|
||||
{
|
||||
code ~= specialChars.length
|
||||
?
|
||||
" if(c < " ~ tableSizeStr ~ ")\n"
|
||||
code ~= " if(c < " ~ tableSizeStr ~ ")\n"
|
||||
" {\n"
|
||||
" return cast(bool)table_[c];\n"
|
||||
" }\n"
|
||||
:
|
||||
" return cast(bool)table_[c];\n";
|
||||
}
|
||||
if(specialChars.length)
|
||||
{
|
||||
code ~= " return " ~ specialCharsCode() ~ ";\n";
|
||||
" }\n";
|
||||
}
|
||||
|
||||
code ~= " assert(false);\n"
|
||||
"}\n";
|
||||
code ~= specialChars.length
|
||||
? " return " ~ specialCharsCode() ~ ";\n"
|
||||
: " return false";
|
||||
code ~= "}\n";
|
||||
|
||||
return code;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue