Ignore:
Timestamp:
Jul 3, 2006 10:08:47 PM (18 years ago)
Author:
bennylp
Message:

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..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/hash.c

    r433 r583  
    7676    long i; 
    7777 
     78#if defined(PJ_HASH_USE_OWN_TOLOWER) && PJ_HASH_USE_OWN_TOLOWER != 0 
     79    for (i=0; i<key->slen; ++i) { 
     80        pj_uint8_t c = key->ptr[i]; 
     81        if (c & 64) 
     82            result[i] = (char)(c | 32); 
     83        else 
     84            result[i] = (char)c; 
     85        hval = hval * PJ_HASH_MULTIPLIER + result[i]; 
     86    } 
     87#else 
    7888    for (i=0; i<key->slen; ++i) { 
    7989        result[i] = (char)pj_tolower(key->ptr[i]); 
    8090        hval = hval * PJ_HASH_MULTIPLIER + result[i]; 
    8191    } 
     92#endif 
    8293 
    8394    return hval; 
Note: See TracChangeset for help on using the changeset viewer.