diff --git a/include/podio/EventStore.h b/include/podio/EventStore.h index f8ee70dc4..662d18e49 100644 --- a/include/podio/EventStore.h +++ b/include/podio/EventStore.h @@ -58,11 +58,6 @@ class DEPR_EVTSTORE EventStore : public ICollectionProvider, public IMetaDataPro template bool get(const std::string& name, const T*& collection); - /// fast access to cached collections - CollectionBase* getFast(int id) const { - return (m_cachedCollections.size() > (unsigned)id ? m_cachedCollections[id] : nullptr); - } - /// access a collection by ID. returns true if successful bool get(int id, CollectionBase*& coll) const final; @@ -120,7 +115,6 @@ class DEPR_EVTSTORE EventStore : public ICollectionProvider, public IMetaDataPro // members mutable std::set m_retrievedIDs{}; mutable CollContainer m_collections{}; - mutable std::vector m_cachedCollections{}; IReader* m_reader{nullptr}; std::shared_ptr m_table; diff --git a/src/EventStore.cc b/src/EventStore.cc index 85dfb3a09..aeb3a716f 100644 --- a/src/EventStore.cc +++ b/src/EventStore.cc @@ -7,7 +7,6 @@ namespace podio { EventStore::EventStore() : m_table(new CollectionIDTable()) { - m_cachedCollections.resize(128); // allow for a sufficiently large initial number of collections } EventStore::~EventStore() { @@ -17,23 +16,12 @@ EventStore::~EventStore() { } bool EventStore::get(int id, CollectionBase*& collection) const { - // see if we have a cached collection - if ((collection = getFast(id)) != nullptr) { - return true; - } - auto val = m_retrievedIDs.insert(id); bool success = false; if (val.second == true) { // collection not yet retrieved in recursive-call auto name = m_table->name(id); success = doGet(name, collection, true); - if (collection != nullptr) { // cache the collection for faster retreaval later - if (m_cachedCollections.size() < (unsigned)id + 1) { - m_cachedCollections.resize(id + 1); - } - m_cachedCollections[id] = collection; - } } else { // collection already requested in recursive call // do not set the references to break collection dependency-cycle @@ -135,8 +123,6 @@ void EventStore::clear() { void EventStore::clearCaches() { m_collections.clear(); - m_cachedCollections.clear(); - m_cachedCollections.resize(128); m_retrievedIDs.clear(); } diff --git a/src/MurmurHash2.cpp b/src/MurmurHash2.cpp index 8f5fb436d..704c193e3 100644 --- a/src/MurmurHash2.cpp +++ b/src/MurmurHash2.cpp @@ -69,8 +69,8 @@ uint32_t MurmurHash2 ( const void * key, int len, uint32_t seed ) switch(len) { - case 3: h ^= data[2] << 16; break; - case 2: h ^= data[1] << 8; break; + case 3: h ^= data[2] << 16; [[fallthrough]]; + case 2: h ^= data[1] << 8; [[fallthrough]]; case 1: h ^= data[0]; h *= m; }; @@ -119,12 +119,12 @@ uint64_t MurmurHash64A ( const void * key, int len, uint64_t seed ) switch(len & 7) { - case 7: h ^= uint64_t(data2[6]) << 48; break; - case 6: h ^= uint64_t(data2[5]) << 40; break; - case 5: h ^= uint64_t(data2[4]) << 32; break; - case 4: h ^= uint64_t(data2[3]) << 24; break; - case 3: h ^= uint64_t(data2[2]) << 16; break; - case 2: h ^= uint64_t(data2[1]) << 8; break; + case 7: h ^= uint64_t(data2[6]) << 48; [[fallthrough]]; + case 6: h ^= uint64_t(data2[5]) << 40; [[fallthrough]]; + case 5: h ^= uint64_t(data2[4]) << 32; [[fallthrough]]; + case 4: h ^= uint64_t(data2[3]) << 24; [[fallthrough]]; + case 3: h ^= uint64_t(data2[2]) << 16; [[fallthrough]]; + case 2: h ^= uint64_t(data2[1]) << 8; [[fallthrough]]; case 1: h ^= uint64_t(data2[0]); h *= m; }; @@ -172,9 +172,9 @@ uint64_t MurmurHash64B ( const void * key, int len, uint64_t seed ) switch(len) { - case 3: h2 ^= ((unsigned char*)data)[2] << 16; break; - case 2: h2 ^= ((unsigned char*)data)[1] << 8; break; - case 1: h2 ^= ((unsigned char*)data)[0]; break; + case 3: h2 ^= ((unsigned char*)data)[2] << 16; [[fallthrough]]; + case 2: h2 ^= ((unsigned char*)data)[1] << 8; [[fallthrough]]; + case 1: h2 ^= ((unsigned char*)data)[0]; [[fallthrough]]; h2 *= m; }; @@ -227,8 +227,8 @@ uint32_t MurmurHash2A ( const void * key, int len, uint32_t seed ) switch(len) { - case 3: t ^= data[2] << 16; break; - case 2: t ^= data[1] << 8; break; + case 3: t ^= data[2] << 16; [[fallthrough]]; + case 2: t ^= data[1] << 8; [[fallthrough]]; case 1: t ^= data[0]; }; @@ -448,8 +448,8 @@ uint32_t MurmurHashAligned2 ( const void * key, int len, uint32_t seed ) { switch(align) { - case 3: d |= data[2] << 16; break; - case 2: d |= data[1] << 8; break; + case 3: d |= data[2] << 16; [[fallthrough]]; + case 2: d |= data[1] << 8; [[fallthrough]]; case 1: d |= data[0]; } @@ -464,8 +464,8 @@ uint32_t MurmurHashAligned2 ( const void * key, int len, uint32_t seed ) switch(len) { - case 3: h ^= data[2] << 16; break; - case 2: h ^= data[1] << 8; break; + case 3: h ^= data[2] << 16; [[fallthrough]]; + case 2: h ^= data[1] << 8; [[fallthrough]]; case 1: h ^= data[0]; h *= m; }; @@ -474,9 +474,9 @@ uint32_t MurmurHashAligned2 ( const void * key, int len, uint32_t seed ) { switch(len) { - case 3: d |= data[2] << 16; break; - case 2: d |= data[1] << 8; break; - case 1: d |= data[0]; break; + case 3: d |= data[2] << 16; [[fallthrough]]; + case 2: d |= data[1] << 8; [[fallthrough]]; + case 1: d |= data[0]; [[fallthrough]]; case 0: h ^= (t >> sr) | (d << sl); h *= m; } @@ -505,8 +505,8 @@ uint32_t MurmurHashAligned2 ( const void * key, int len, uint32_t seed ) switch(len) { - case 3: h ^= data[2] << 16; break; - case 2: h ^= data[1] << 8; break; + case 3: h ^= data[2] << 16; [[fallthrough]]; + case 2: h ^= data[1] << 8; [[fallthrough]]; case 1: h ^= data[0]; h *= m; };