From 902d66eb8304ccffdb683b7130e9f548011b8d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 9 May 2008 17:51:40 +0200 Subject: 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. --- src/demuxers/demux_str.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/demuxers/demux_str.c') diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index 97e025504..1e750f183 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -188,9 +188,7 @@ static int open_str_file(demux_str_t *this) { unsigned char check_bytes[STR_CHECK_BYTES]; int local_offset, sector, channel; - for (channel = 0; channel < STR_MAX_CHANNELS; channel++) { - this->channel_type[channel] = 0; - } + memset(this->channel_type, 0, sizeof(this->channel_type)); this->input->seek(this->input, 0, SEEK_SET); if (this->input->read(this->input, check_bytes, STR_CHECK_BYTES) != -- cgit v1.2.3