Skip to content

Commit

Permalink
8328997: Remove unnecessary template parameter lists in GrowableArray
Browse files Browse the repository at this point in the history
Reviewed-by: mdoerr
Backport-of: 3d2283800acee58dbf046c8b401a5a144ab65ed1
  • Loading branch information
Jan Kratochvil authored and TheRealMDoerr committed May 16, 2024
1 parent 2440b24 commit d17fa03
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/hotspot/share/utilities/growableArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ class GrowableArrayView : public GrowableArrayBase {
protected:
E* _data; // data array

GrowableArrayView<E>(E* data, int initial_max, int initial_len) :
GrowableArrayView(E* data, int initial_max, int initial_len) :
GrowableArrayBase(initial_max, initial_len), _data(data) {}

~GrowableArrayView() {}

public:
const static GrowableArrayView EMPTY;

bool operator==(const GrowableArrayView<E>& rhs) const {
bool operator==(const GrowableArrayView& rhs) const {
if (_len != rhs._len)
return false;
for (int i = 0; i < _len; i++) {
Expand All @@ -137,7 +137,7 @@ class GrowableArrayView : public GrowableArrayBase {
return true;
}

bool operator!=(const GrowableArrayView<E>& rhs) const {
bool operator!=(const GrowableArrayView& rhs) const {
return !(*this == rhs);
}

Expand Down Expand Up @@ -467,7 +467,7 @@ class GrowableArrayWithAllocator : public GrowableArrayView<E> {
return this->at(location);
}

void swap(GrowableArrayWithAllocator<E, Derived>* other) {
void swap(GrowableArrayWithAllocator* other) {
::swap(this->_data, other->_data);
::swap(this->_len, other->_len);
::swap(this->_max, other->_max);
Expand Down Expand Up @@ -618,8 +618,8 @@ class GrowableArrayMetadata {
// See: init_checks.

template <typename E>
class GrowableArray : public GrowableArrayWithAllocator<E, GrowableArray<E> > {
friend class GrowableArrayWithAllocator<E, GrowableArray<E> >;
class GrowableArray : public GrowableArrayWithAllocator<E, GrowableArray<E>> {
friend class GrowableArrayWithAllocator<E, GrowableArray>;
friend class GrowableArrayTest;

static E* allocate(int max) {
Expand Down Expand Up @@ -669,23 +669,23 @@ class GrowableArray : public GrowableArrayWithAllocator<E, GrowableArray<E> > {

public:
GrowableArray(int initial_max = 2, MEMFLAGS memflags = mtNone) :
GrowableArrayWithAllocator<E, GrowableArray<E> >(
GrowableArrayWithAllocator<E, GrowableArray>(
allocate(initial_max, memflags),
initial_max),
_metadata(memflags) {
init_checks();
}

GrowableArray(int initial_max, int initial_len, const E& filler, MEMFLAGS memflags = mtNone) :
GrowableArrayWithAllocator<E, GrowableArray<E> >(
GrowableArrayWithAllocator<E, GrowableArray>(
allocate(initial_max, memflags),
initial_max, initial_len, filler),
_metadata(memflags) {
init_checks();
}

GrowableArray(Arena* arena, int initial_max, int initial_len, const E& filler) :
GrowableArrayWithAllocator<E, GrowableArray<E> >(
GrowableArrayWithAllocator<E, GrowableArray>(
allocate(initial_max, arena),
initial_max, initial_len, filler),
_metadata(arena) {
Expand Down Expand Up @@ -766,15 +766,15 @@ class GrowableArrayIterator : public StackObj {

public:
GrowableArrayIterator() : _array(NULL), _position(0) { }
GrowableArrayIterator<E>& operator++() { ++_position; return *this; }
E operator*() { return _array->at(_position); }
GrowableArrayIterator& operator++() { ++_position; return *this; }
E operator*() { return _array->at(_position); }

bool operator==(const GrowableArrayIterator<E>& rhs) {
bool operator==(const GrowableArrayIterator& rhs) {
assert(_array == rhs._array, "iterator belongs to different array");
return _position == rhs._position;
}

bool operator!=(const GrowableArrayIterator<E>& rhs) {
bool operator!=(const GrowableArrayIterator& rhs) {
assert(_array == rhs._array, "iterator belongs to different array");
return _position != rhs._position;
}
Expand Down

1 comment on commit d17fa03

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.