From 9193f4c4d7e89bab3778baf888f5936d720881f9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 26 Oct 2019 21:21:55 -0400 Subject: [PATCH] CCharLayoutInfo: Make use of const where applicable Makes trivial variables const to make it explicit that they aren't modified. --- Runtime/Character/CCharLayoutInfo.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Runtime/Character/CCharLayoutInfo.cpp b/Runtime/Character/CCharLayoutInfo.cpp index 29c69173f..a13eea4f5 100644 --- a/Runtime/Character/CCharLayoutInfo.cpp +++ b/Runtime/Character/CCharLayoutInfo.cpp @@ -32,16 +32,18 @@ void CCharLayoutNode::Bone::read(CInputStream& in) { x0_parentId = CSegId(in); x4_origin.readBig(in); - u32 chCount = in.readUint32Big(); + const u32 chCount = in.readUint32Big(); x10_children.reserve(chCount); - for (u32 i = 0; i < chCount; ++i) + for (u32 i = 0; i < chCount; ++i) { x10_children.emplace_back(in); + } } CCharLayoutNode::CCharLayoutNode(CInputStream& in) : x0_boneMap(in.readUint32Big()) { - u32 cap = x0_boneMap.GetCapacity(); + const u32 cap = x0_boneMap.GetCapacity(); + for (u32 i = 0; i < cap; ++i) { - u32 thisId = in.readUint32Big(); + const u32 thisId = in.readUint32Big(); Bone& bone = x0_boneMap[thisId]; bone.read(in); }