From ca57331bd31b0f7b7bddf6d64119271175e7f513 Mon Sep 17 00:00:00 2001 From: lhu Date: Fri, 1 Nov 2024 14:49:54 -0400 Subject: [PATCH] Clean up ClassStaticsIterator class Use consistent data types and code formatting Signed-off-by: lhu --- runtime/gc_structs/ClassStaticsIterator.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/runtime/gc_structs/ClassStaticsIterator.hpp b/runtime/gc_structs/ClassStaticsIterator.hpp index a8fed141030..633bc08c12b 100644 --- a/runtime/gc_structs/ClassStaticsIterator.hpp +++ b/runtime/gc_structs/ClassStaticsIterator.hpp @@ -44,7 +44,7 @@ */ class GC_ClassStaticsIterator { - U_32 _objectStaticCount; + uint32_t _objectStaticCount; j9object_t *_staticPtr; public: @@ -104,13 +104,12 @@ class GC_ClassStaticsIterator volatile j9object_t * nextSlot() { - j9object_t *slotPtr; + j9object_t *slotPtr = NULL; - if (0 == _objectStaticCount) { - return NULL; + if (0 != _objectStaticCount) { + _objectStaticCount -= 1; + slotPtr = _staticPtr++; } - _objectStaticCount -= 1; - slotPtr = _staticPtr++; return slotPtr; }