From fe679e5479e96770ee842a506b23682d018b6519 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 10 Jul 2020 15:43:36 -0400 Subject: [PATCH] CSelectionIterator: Make use of in-class initializers --- src/Editor/CSelectionIterator.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Editor/CSelectionIterator.h b/src/Editor/CSelectionIterator.h index 9f92d88a..44a51d10 100644 --- a/src/Editor/CSelectionIterator.h +++ b/src/Editor/CSelectionIterator.h @@ -6,19 +6,19 @@ class CSelectionIterator { CNodeSelection *mpSelection; - uint32 mCurrentIndex; + uint32 mCurrentIndex = 0; public: - CSelectionIterator(CNodeSelection *pSelection) - : mpSelection(pSelection), mCurrentIndex(0) {} + explicit CSelectionIterator(CNodeSelection *pSelection) + : mpSelection(pSelection) {} - inline void Next() { mCurrentIndex++; } - inline bool DoneIterating() const { return (mCurrentIndex == mpSelection->Size()); } - inline operator bool() const { return !DoneIterating(); } - inline CSceneNode* operator*() const { return mpSelection->At(mCurrentIndex); } - inline CSceneNode* operator->() const { return mpSelection->At(mCurrentIndex); } - inline CSelectionIterator& operator++() { Next(); return *this; } - inline CSelectionIterator operator++(int) { CSelectionIterator Copy = *this; Next(); return Copy; } + void Next() { mCurrentIndex++; } + bool DoneIterating() const { return (mCurrentIndex == mpSelection->Size()); } + explicit operator bool() const { return !DoneIterating(); } + CSceneNode* operator*() const { return mpSelection->At(mCurrentIndex); } + CSceneNode* operator->() const { return mpSelection->At(mCurrentIndex); } + CSelectionIterator& operator++() { Next(); return *this; } + CSelectionIterator operator++(int) { CSelectionIterator Copy = *this; Next(); return Copy; } }; #endif // CSELECTIONITERATOR