From dccfd2b3e0636488e255da1fa5b1b58e9bc1b606 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 27 Oct 2020 08:16:43 +0000 Subject: [PATCH] 8255389: ConcurrentHashTable::NoOp omits return in non-void return method Reviewed-by: kbarrett, rehn --- src/hotspot/share/utilities/concurrentHashTable.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/utilities/concurrentHashTable.hpp b/src/hotspot/share/utilities/concurrentHashTable.hpp index bec1661d4ce..154672ece92 100644 --- a/src/hotspot/share/utilities/concurrentHashTable.hpp +++ b/src/hotspot/share/utilities/concurrentHashTable.hpp @@ -191,13 +191,6 @@ class ConcurrentHashTable : public CHeapObj { Bucket* get_bucket(size_t idx) { return &_buckets[idx]; } }; - // Used as default functor when no functor supplied for some methods. - struct NoOp { - void operator()(VALUE*) {} - const VALUE& operator()() {} - void operator()(bool, VALUE*) {} - } noOp; - // For materializing a supplied value. class LazyValueRetrieve { private: @@ -429,7 +422,10 @@ class ConcurrentHashTable : public CHeapObj { // Same without DELETE_FUNC. template bool remove(Thread* thread, LOOKUP_FUNC& lookup_f) { - return internal_remove(thread, lookup_f, noOp); + struct { + void operator()(VALUE*) {} + } ignore_del_f; + return internal_remove(thread, lookup_f, ignore_del_f); } // Visit all items with SCAN_FUNC if no concurrent resize. Takes the resize