From acc4a828184bd2838a5c0b572f404aa1edaf59e2 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 25 Mar 2024 07:07:47 +0000 Subject: [PATCH] 8328862: Remove unused GrowableArrayFilterIterator Reviewed-by: dholmes --- src/hotspot/share/utilities/growableArray.hpp | 54 +------------------ 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/src/hotspot/share/utilities/growableArray.hpp b/src/hotspot/share/utilities/growableArray.hpp index abac729d3c8..bf4c6e96fc9 100644 --- a/src/hotspot/share/utilities/growableArray.hpp +++ b/src/hotspot/share/utilities/growableArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,7 +102,6 @@ public: }; template class GrowableArrayIterator; -template class GrowableArrayFilterIterator; // Extends GrowableArrayBase with a typed data array. // @@ -841,7 +840,6 @@ public: template class GrowableArrayIterator : public StackObj { friend class GrowableArrayView; - template friend class GrowableArrayFilterIterator; private: const GrowableArrayView* _array; // GrowableArray we iterate over @@ -868,56 +866,6 @@ class GrowableArrayIterator : public StackObj { } }; -// Custom STL-style iterator to iterate over elements of a GrowableArray that satisfy a given predicate -template -class GrowableArrayFilterIterator : public StackObj { - friend class GrowableArrayView; - - private: - const GrowableArrayView* _array; // GrowableArray we iterate over - int _position; // Current position in the GrowableArray - UnaryPredicate _predicate; // Unary predicate the elements of the GrowableArray should satisfy - - public: - GrowableArrayFilterIterator(const GrowableArrayIterator& begin, UnaryPredicate filter_predicate) : - _array(begin._array), _position(begin._position), _predicate(filter_predicate) { - // Advance to first element satisfying the predicate - while(_position != _array->length() && !_predicate(_array->at(_position))) { - ++_position; - } - } - - GrowableArrayFilterIterator& operator++() { - do { - // Advance to next element satisfying the predicate - ++_position; - } while(_position != _array->length() && !_predicate(_array->at(_position))); - return *this; - } - - E operator*() { return _array->at(_position); } - - bool operator==(const GrowableArrayIterator& rhs) { - assert(_array == rhs._array, "iterator belongs to different array"); - return _position == rhs._position; - } - - bool operator!=(const GrowableArrayIterator& rhs) { - assert(_array == rhs._array, "iterator belongs to different array"); - return _position != rhs._position; - } - - bool operator==(const GrowableArrayFilterIterator& rhs) { - assert(_array == rhs._array, "iterator belongs to different array"); - return _position == rhs._position; - } - - bool operator!=(const GrowableArrayFilterIterator& rhs) { - assert(_array == rhs._array, "iterator belongs to different array"); - return _position != rhs._position; - } -}; - // Arrays for basic types typedef GrowableArray intArray; typedef GrowableArray intStack;