Changeset 2140 for pjproject/trunk


Ignore:
Timestamp:
Jul 14, 2008 5:53:58 PM (16 years ago)
Author:
bennylp
Message:

Slight optimization in GUID generation for Win32 (removed unnecessary copy before encoding to string)

File:
1 edited

Legend:

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

    r2039 r2140  
    4040} 
    4141 
    42 static void guid_to_str( const GUID *guid, pj_str_t *str ) 
     42static void guid_to_str( GUID *guid, pj_str_t *str ) 
    4343{ 
    4444    unsigned i; 
    45     GUID guid_copy; 
    46     const unsigned char *src = (const unsigned char*)&guid_copy; 
     45    const unsigned char *src = (const unsigned char*)guid; 
    4746    char *dst = str->ptr; 
    4847 
    49     pj_memcpy(&guid_copy, guid, sizeof(*guid)); 
    50     guid_copy.Data1 = pj_ntohl(guid_copy.Data1); 
    51     guid_copy.Data2 = pj_ntohs(guid_copy.Data2); 
    52     guid_copy.Data3 = pj_ntohs(guid_copy.Data3); 
     48    guid->Data1 = pj_ntohl(guid->Data1); 
     49    guid->Data2 = pj_ntohs(guid->Data2); 
     50    guid->Data3 = pj_ntohs(guid->Data3); 
    5351 
    5452    for (i=0; i<16; ++i) { 
Note: See TracChangeset for help on using the changeset viewer.