diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 17:51:40 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 17:51:40 +0200 |
commit | 902d66eb8304ccffdb683b7130e9f548011b8d30 (patch) | |
tree | 9cdd73b5f68131ba2d4944d17e183b4313bdb559 /src/demuxers/demux_slave.c | |
parent | a51427608e2f4543ae0cb0598517a1e4f6b0928b (diff) | |
download | xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.gz xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.bz2 |
Avoid loop for common memory operations (zeroing, copying, moving).
Use the proper function for common memory operations (memset() for
zeroing, memcpy() for copying, memmove() for moving), instead of
looping through arrays.
By extension, remove loops to reset arrays when they were allocated
with calloc() and thus already zeroed.
Diffstat (limited to 'src/demuxers/demux_slave.c')
-rw-r--r-- | src/demuxers/demux_slave.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/demuxers/demux_slave.c b/src/demuxers/demux_slave.c index c2d427d8c..28a89a973 100644 --- a/src/demuxers/demux_slave.c +++ b/src/demuxers/demux_slave.c @@ -186,10 +186,8 @@ static int demux_slave_next (demux_slave_t *this) { buf->decoder_flags = decoder_flags; /* set decoder info */ - for( i = 0; i < BUF_NUM_DEC_INFO; i++ ) { - buf->decoder_info[i] = this->decoder_info[i]; - buf->decoder_info_ptr[i] = this->decoder_info_ptr[i]; - } + memcpy(buf->decoder_info, this->decoder_info, sizeof(this->decoder_info)); + memcpy(buf->decoder_info_ptr, this->decoder_info_ptr, sizeof(this->decoder_info)); memset(this->decoder_info, 0, sizeof(this->decoder_info)); memset(this->decoder_info_ptr, 0, sizeof(this->decoder_info_ptr)); |