summaryrefslogtreecommitdiffstats
path: root/qtools/qgdict.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2005-04-21 21:10:51 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2005-04-21 21:10:51 (GMT)
commit4a8c2f5c896a1883a0611d972952a68498002ae5 (patch)
tree81218085d3e6e15b1ce6c418734013d48e9deda8 /qtools/qgdict.cpp
parent570375c30adbdb66714d465d849b18e0df9dd6e6 (diff)
downloadDoxygen-4a8c2f5c896a1883a0611d972952a68498002ae5.zip
Doxygen-4a8c2f5c896a1883a0611d972952a68498002ae5.tar.gz
Doxygen-4a8c2f5c896a1883a0611d972952a68498002ae5.tar.bz2
Release-1.4.2-20050421
Diffstat (limited to 'qtools/qgdict.cpp')
-rw-r--r--qtools/qgdict.cpp8
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;