Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc274d44 authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

libeffects: use memmove in Copy_Float

Bug: 120944950
Test: lvm/tests/build_and_run_all_unit_tests.sh
Test: lvm/tests/build_and_run_all_unit_tests_reverb.sh

Change-Id: I1d4a9c92d02ad0943eba32e5434218a13ac78563
parent a4c84f69
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
/**********************************************************************************
   INCLUDE FILES
***********************************************************************************/

#include <string.h>
#include "VectorArithmetic.h"

/**********************************************************************************
@@ -47,24 +47,7 @@ void Copy_16(const LVM_INT16* src, LVM_INT16* dst, LVM_INT16 n) {
    return;
}
void Copy_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n) {
    LVM_INT16 ii;

    if (src > dst) {
        for (ii = n; ii != 0; ii--) {
            *dst = *src;
            dst++;
            src++;
        }
    } else {
        src += n - 1;
        dst += n - 1;
        for (ii = n; ii != 0; ii--) {
            *dst = *src;
            dst--;
            src--;
        }
    }

    memmove(dst, src, n * sizeof(LVM_FLOAT));
    return;
}
// Extract out the stereo channel pair from multichannel source.