diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-04-21 21:10:51 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-04-21 21:10:51 (GMT) |
commit | 5d31b7ab211586100301d6838be82f066f8f9af4 (patch) | |
tree | 81218085d3e6e15b1ce6c418734013d48e9deda8 /qtools/qgdict.cpp | |
parent | 76e39987363c93fdd3f2d99ffdb9f87743d6af7c (diff) | |
download | Doxygen-5d31b7ab211586100301d6838be82f066f8f9af4.zip Doxygen-5d31b7ab211586100301d6838be82f066f8f9af4.tar.gz Doxygen-5d31b7ab211586100301d6838be82f066f8f9af4.tar.bz2 |
Release-1.4.2-20050421
Diffstat (limited to 'qtools/qgdict.cpp')
-rw-r--r-- | qtools/qgdict.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/qtools/qgdict.cpp b/qtools/qgdict.cpp index e9306bb..e55d059 100644 --- a/qtools/qgdict.cpp +++ b/qtools/qgdict.cpp @@ -92,16 +92,17 @@ int QGDict::hashKeyString( const QString &key ) int i; register uint h=0; uint g; + int len = key.length(); const QChar *p = key.unicode(); if ( cases ) { // case sensitive - for ( i=0; i<(int)key.length(); i++ ) { + for ( i=0; i<len; i++ ) { h = (h<<4) + p[i].cell(); if ( (g = h & 0xf0000000) ) h ^= g >> 24; h &= ~g; } } else { // case insensitive - for ( i=0; i<(int)key.length(); i++ ) { + for ( i=0; i<len; i++ ) { h = (h<<4) + p[i].lower().cell(); if ( (g = h & 0xf0000000) ) h ^= g >> 24; @@ -123,7 +124,10 @@ int QGDict::hashKeyAscii( const char *key ) { #if defined(CHECK_NULL) if ( key == 0 ) + { qWarning( "QGDict::hashAsciiKey: Invalid null key" ); + return 0; + } #endif register const char *k = key; register uint h=0; |