Added pure/@safe/nothrow where possible.

This commit is contained in:
kiith-sa 2012-09-09 01:42:13 +02:00
parent 37a661b034
commit 4f78702a57
20 changed files with 446 additions and 426 deletions

View file

@ -35,7 +35,7 @@ template FastCharSearch(dstring chars, uint tableSize = 256)
}
///Generate the search table and the canFind method.
string searchCode(dstring chars, uint tableSize)()
string searchCode(dstring chars, uint tableSize)() @trusted
{
const tableSizeStr = to!string(tableSize);
ubyte[tableSize] table;
@ -76,14 +76,14 @@ string searchCode(dstring chars, uint tableSize)()
string code = tableSize ? tableCode() : "";
code ~= "bool canFind(in dchar c) pure\n"
code ~= "bool canFind(in dchar c) pure @safe nothrow\n"
"{\n";
if(tableSize)
{
code ~= " if(c < " ~ tableSizeStr ~ ")\n"
" {\n"
" return cast(bool)table_[c];\n"
" return cast(immutable(bool))table_[c];\n"
" }\n";
}