Permalink
Browse files

Made several improvements to the performance of template engine

  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Sep 9, 2015
1 parent 3941a16 commit ded4e9a92670d0157cdcc5cbf7a4a1e3193e179a
Showing with 1,895 additions and 1,409 deletions.
  1. +26 −0 qtools/qgdict.cpp
  2. +1,730 −1,157 src/context.cpp
  3. +4 −3 src/definition.cpp
  4. +6 −1 src/definition.h
  5. +46 −228 src/template.cpp
  6. +83 −20 src/template.h
@@ -154,6 +154,32 @@ int QGDict::hashKeyAscii( const char *key )
return index;
}
#if 0
int QGDict::hashKeyAscii( const char *key )
{
#if defined(CHECK_NULL)
if ( key == 0 )
{
qWarning( "QGDict::hashAsciiKey: Invalid null key" );
return 0;
}
#endif
unsigned int hash = 5381;
int c;
// use djb2 by Dan Bernstein
if (cases)
{
while ((c=*key++)) hash = ((hash<<5)+hash)+c;
}
else
{
while ((c=*key++)) hash = ((hash<<5)+hash)+tolower(c);
}
int index = hash;
return index<0 ? -index : index;
}
#endif
#ifndef QT_NO_DATASTREAM
/*!
Oops, something went wrong.

0 comments on commit ded4e9a

Please sign in to comment.