diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-03 22:08:47 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-03 22:08:47 +0000 |
commit | 31d42235239a1291a599b84cc352b7b5b53448b7 (patch) | |
tree | 5770b56b29cbd313e47e5067fa3ee4a3b4895240 /pjlib | |
parent | ed98898bb501d02e69093d34961bf1fb46d2ed4d (diff) |
Various performance improvements in PJSIP: (1) optimizing for common case to minimize stricmp() calls (header names, method, URI schemes), (2) added functionality in scanner to parse and unescape in-place, (3) etc..
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@583 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/src/pj/hash.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c index 1f86317b..10ad9d97 100644 --- a/pjlib/src/pj/hash.c +++ b/pjlib/src/pj/hash.c @@ -75,10 +75,21 @@ PJ_DEF(pj_uint32_t) pj_hash_calc_tolower( pj_uint32_t hval, { long i; +#if defined(PJ_HASH_USE_OWN_TOLOWER) && PJ_HASH_USE_OWN_TOLOWER != 0 + for (i=0; i<key->slen; ++i) { + pj_uint8_t c = key->ptr[i]; + if (c & 64) + result[i] = (char)(c | 32); + else + result[i] = (char)c; + hval = hval * PJ_HASH_MULTIPLIER + result[i]; + } +#else for (i=0; i<key->slen; ++i) { result[i] = (char)pj_tolower(key->ptr[i]); hval = hval * PJ_HASH_MULTIPLIER + result[i]; } +#endif return hval; } |