From ea153d4cf6354f4ab51d2705084e79c40a00996e Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 5 Feb 2023 12:49:43 +0100 Subject: [PATCH] Minor adjustment to inline function in more places for CPU particles perf --- Source/Engine/Particles/ParticlesData.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/Engine/Particles/ParticlesData.h b/Source/Engine/Particles/ParticlesData.h index c47e18dc8..5f8dd6332 100644 --- a/Source/Engine/Particles/ParticlesData.h +++ b/Source/Engine/Particles/ParticlesData.h @@ -423,19 +423,16 @@ public: return Get(index); } - T Get(int32 index) const + FORCE_INLINE T Get(int32 index) const { - ASSERT(IsValid()); - ASSERT(index >= 0 && index < _buffer->CPU.Count); + ASSERT(IsValid() && index >= 0 && index < _buffer->CPU.Count); return *(T*)(_buffer->CPU.Buffer.Get() + _offset + index * _buffer->Stride); } FORCE_INLINE T Get(int32 index, const T& defaultValue) const { if (IsValid()) - { return Get(index); - } return defaultValue; } };