From d9c29a2c4f1d3e283350c6b334711f3b772bbcf4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 9 Dec 2016 22:20:07 +0100 Subject: [PATCH] decoder/wavpack: use std::copy_n() --- src/decoder/plugins/WavpackDecoderPlugin.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx index fa307d5c8..fcc0890f8 100644 --- a/src/decoder/plugins/WavpackDecoderPlugin.cxx +++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx @@ -98,9 +98,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count) static_assert(sizeof(*dst) <= sizeof(*src), "Wrong size"); /* pass through and align 8-bit samples */ - while (count--) { - *dst++ = *src++; - } + std::copy_n(src, count, dst); break; } case 2: { @@ -108,9 +106,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count) static_assert(sizeof(*dst) <= sizeof(*src), "Wrong size"); /* pass through and align 16-bit samples */ - while (count--) { - *dst++ = *src++; - } + std::copy_n(src, count, dst); break; }