From 47f416efafd751b2a92ed01882f6c4ad3d4c3587 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 9 Dec 2019 23:11:16 -0800 Subject: [PATCH] Simplify a couple assignments --- utils/makemhr/loadsofa.cpp | 8 +++----- utils/sofa-info.cpp | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/utils/makemhr/loadsofa.cpp b/utils/makemhr/loadsofa.cpp index b5dcf2ef..886bd6ff 100644 --- a/utils/makemhr/loadsofa.cpp +++ b/utils/makemhr/loadsofa.cpp @@ -193,11 +193,9 @@ static bool PrepareLayout(const uint m, const float *xyzs, HrirDataT *hData) auto aers = std::vector(m, double3{}); for(uint i{0u};i < m;++i) { - float aer[3]{xyzs[i*3], xyzs[i*3 + 1], xyzs[i*3 + 2]}; - mysofa_c2s(&aer[0]); - aers[i][0] = aer[0]; - aers[i][1] = aer[1]; - aers[i][2] = aer[2]; + float vals[3]{xyzs[i*3], xyzs[i*3 + 1], xyzs[i*3 + 2]}; + mysofa_c2s(&vals[0]); + aers[i] = {vals[0], vals[1], vals[2]}; } auto radii = GetUniquelySortedElems(aers, 2, {}, {0.1, 0.1, 0.001}); diff --git a/utils/sofa-info.cpp b/utils/sofa-info.cpp index b7346939..81136334 100644 --- a/utils/sofa-info.cpp +++ b/utils/sofa-info.cpp @@ -214,11 +214,9 @@ static void PrintCompatibleLayout(const uint m, const float *xyzs) auto aers = std::vector(m, double3{}); for(uint i{0u};i < m;++i) { - float aer[3]{xyzs[i*3], xyzs[i*3 + 1], xyzs[i*3 + 2]}; - mysofa_c2s(&aer[0]); - aers[i][0] = aer[0]; - aers[i][1] = aer[1]; - aers[i][2] = aer[2]; + float vals[3]{xyzs[i*3], xyzs[i*3 + 1], xyzs[i*3 + 2]}; + mysofa_c2s(&vals[0]); + aers[i] = {vals[0], vals[1], vals[2]}; } auto radii = GetUniquelySortedElems(aers, 2, {}, {0.1, 0.1, 0.001});