String compare performance

Kagamin spam at here.lot
Sat Nov 27 15:18:57 PST 2010


or

bool cmp3c(string a, string b) pure
{
  if(a.length!=3)return false;
  return *cast(char[3]*)a.ptr==*cast(char[3]*)b.ptr;
}

llvm.memcmp should rock with lengths known at compile time.


More information about the Digitalmars-d mailing list