Minor adjustment to inline function in more places for CPU particles perf

This commit is contained in:
Wojtek Figat
2023-02-05 12:49:43 +01:00
parent f085e8e199
commit ea153d4cf6

View File

@@ -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;
}
};