From e12f2ba13ff04d5429ecf5753b583d98ead380d4 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 23 Dec 2023 23:05:07 +0800 Subject: [PATCH] minor --- src/util/spec.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/spec.h b/src/util/spec.h index 5d3b742d..0bc6ce07 100644 --- a/src/util/spec.h +++ b/src/util/spec.h @@ -81,9 +81,11 @@ class SampledSpectrum { LUISA_ASSERT(rhs.dimension() == 1u || dimension() == rhs.dimension(), "Invalid spectrum dimensions for operator=: {} vs {}.", dimension(), rhs.dimension()); - compute::outline([&] { + if (rhs.dimension() == 1u) { for (auto i = 0u; i < dimension(); i++) { _samples[i] = rhs[i]; } - }); + } else { + _samples = rhs._samples; + } return *this; } [[nodiscard]] Local &values() noexcept { return _samples; }