Changeset 5282

Show
Ignore:
Timestamp:
10/09/07 09:27:41 (6 years ago)
Author:
jgaeddert
Message:

using memcpy function instead of loops; perhaps slightly faster, but more straightforward

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/Packetizer/trunk/Packetizer-metadata/src/PacketizerDSP.cpp

    r5281 r5282  
    131131    PacketType type) 
    132132{ 
    133     unsigned int i, j; 
     133    unsigned int i; 
    134134    output_index = 0; 
    135135 
     
    156156 
    157157    // write P/N sync code 
    158     for (i=0; i<PN_SYNC_CODE_LENGTH; i++) 
    159         output[output_index++] = pnSyncCode[i]; 
     158    memcpy(output+output_index, pnSyncCode, PN_SYNC_CODE_LENGTH); 
     159    output_index += PN_SYNC_CODE_LENGTH; 
    160160 
    161161    // write control codes 
    162162    for (i=0; i<NUM_CONTROL_CODES; i++) { 
    163         for (j=0; j<PN_CONTROL_CODE_LENGTH; j++) 
    164             output[output_index++] = (controlBlock[i])[j]; 
     163        memcpy(output+output_index, controlBlock[i], PN_CONTROL_CODE_LENGTH); 
     164        output_index += PN_CONTROL_CODE_LENGTH; 
    165165    } 
    166166