[tom, 9/21/2006] This is incredibly lame and adds a pretty big speed penalty
| 45 | |
| 46 | // [tom, 9/21/2006] This is incredibly lame and adds a pretty big speed penalty |
| 47 | inline const char *caseConv(const char *str) |
| 48 | { |
| 49 | if(mCaseSensitive) return str; |
| 50 | |
| 51 | S32 len = dStrlen(str); |
| 52 | if(len >= sizeof(mCaseConvBuf)) len = sizeof(mCaseConvBuf) - 1; |
| 53 | |
| 54 | char *dptr = mCaseConvBuf; |
| 55 | const char *sptr = str; |
| 56 | while(*sptr) |
| 57 | { |
| 58 | *dptr = dTolower(*sptr); |
| 59 | ++sptr; |
| 60 | ++dptr; |
| 61 | } |
| 62 | *dptr = 0; |
| 63 | |
| 64 | return mCaseConvBuf; |
| 65 | } |
| 66 | |
| 67 | public: |
| 68 | SimpleHashTable(const U32 modulusSize = 64, bool caseSensitive = true) : Parent(modulusSize), mCaseSensitive(caseSensitive) |