diff options
Diffstat (limited to 'FoundationEx/Text.cpp')
-rw-r--r-- | FoundationEx/Text.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/FoundationEx/Text.cpp b/FoundationEx/Text.cpp index a845ca0..8a58dc4 100644 --- a/FoundationEx/Text.cpp +++ b/FoundationEx/Text.cpp @@ -48,7 +48,7 @@ TextRep TextRep::nullrep; -TextRep::TextRep() +TextRep::TextRep() : ref(1234567), data(0), length(0), hash(0), sensitive(true) { #ifdef MEM_DEBUG @@ -172,7 +172,7 @@ TextRep::dohash() unsigned hv = (unsigned)length; // Mix in the string length. unsigned i = length*sizeof(char)/sizeof(unsigned); const unsigned* p = (const unsigned*)data; - + while (i--) mash(hv, *p++); // XOR in the characters. @@ -181,7 +181,7 @@ TextRep::dohash() if (i) { unsigned h = 0; const char* c = (const char*)p; - while (i--) + while (i--) h = ((h << 8*sizeof(char)) | *c++); mash(hv, h); } @@ -547,7 +547,7 @@ Text::operator()(int start, int len) const if (start + len > rep->length) len = rep->length - start; -#ifdef MEM_DEBUG +#ifdef MEM_DEBUG char* buf = new(__FILE__,__LINE__) char[len+1]; #else char* buf = new char[len+1]; @@ -685,7 +685,7 @@ Text::toLower() *p = tolower((unsigned char)*p); p++; } - + rep->dohash(); } @@ -699,7 +699,7 @@ Text::toUpper() *p = toupper((unsigned char)*p); p++; } - + rep->dohash(); } |