From 213b5f87ff89ad45d63c9f0657712f24d064a631 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 31 Jan 2013 12:49:56 +0000 Subject: [PATCH] Minor clean-ups. --- modules/juce_core/containers/juce_Array.h | 6 ++---- modules/juce_core/containers/juce_LinkedListPointer.h | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 381deffdd2..2f089d86ab 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -730,10 +730,8 @@ public: minimiseStorageAfterRemoval(); return removed; } - else - { - return ElementType(); - } + + return ElementType(); } /** Removes an item from the array. diff --git a/modules/juce_core/containers/juce_LinkedListPointer.h b/modules/juce_core/containers/juce_LinkedListPointer.h index a80ce9dac4..37f01e5ecc 100644 --- a/modules/juce_core/containers/juce_LinkedListPointer.h +++ b/modules/juce_core/containers/juce_LinkedListPointer.h @@ -218,7 +218,7 @@ public: ObjectType* const oldItem = item; item = newItem; item->nextListItem = oldItem->nextListItem.item; - oldItem->nextListItem = (ObjectType*) 0; + oldItem->nextListItem.item = nullptr; return oldItem; } @@ -259,7 +259,7 @@ public: if (oldItem != nullptr) { item = oldItem->nextListItem; - oldItem->nextListItem = (ObjectType*) 0; + oldItem->nextListItem.item = nullptr; } return oldItem; @@ -270,9 +270,7 @@ public: */ void remove (ObjectType* const itemToRemove) { - LinkedListPointer* const l = findPointerTo (itemToRemove); - - if (l != nullptr) + if (LinkedListPointer* const l = findPointerTo (itemToRemove)) l->removeNext(); }