From dbbae72ca75aaa6c4341708f257d03ba5689982c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 15 Oct 2023 15:52:22 +0200 Subject: [PATCH] Move variable declarations closer to usages --- src/engine/shared/demo.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/engine/shared/demo.cpp b/src/engine/shared/demo.cpp index 33231d520..aecaf39d5 100644 --- a/src/engine/shared/demo.cpp +++ b/src/engine/shared/demo.cpp @@ -308,14 +308,12 @@ void CDemoRecorder::RecordSnapshot(int Tick, const void *pData, int Size) } else { - // create delta, prepend tick - char aDeltaData[CSnapshot::MAX_SIZE + sizeof(int)]; - int DeltaSize; - // write tickmarker WriteTickMarker(Tick, false); - DeltaSize = m_pSnapshotDelta->CreateDelta((CSnapshot *)m_aLastSnapshotData, (CSnapshot *)pData, &aDeltaData); + // create delta + char aDeltaData[CSnapshot::MAX_SIZE + sizeof(int)]; + const int DeltaSize = m_pSnapshotDelta->CreateDelta((CSnapshot *)m_aLastSnapshotData, (CSnapshot *)pData, &aDeltaData); if(DeltaSize) { // record delta