/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#ifndef SQUID_LOOKUPTABLE_H_
#define SQUID_LOOKUPTABLE_H_
-#include "SBuf.h"
+#include "sbuf/Algorithms.h"
+#include "sbuf/SBuf.h"
-#include <map>
+#include <unordered_map>
/**
* a record in the initializer list for a LookupTable
*
*/
-class SBufCaseInsensitiveLess : public std::binary_function<SBuf, SBuf, bool> {
-public:
- bool operator() (const SBuf &x, const SBuf &y) const {
- return x.caseCmp(y) < 0;
- }
-};
-
-template<typename EnumType, typename RecordType = LookupTableRecord<EnumType> >
+template<typename EnumType, typename RecordType = LookupTableRecord<EnumType>, typename Hasher = CaseInsensitiveSBufHash >
class LookupTable
{
public:
}
private:
- typedef std::map<const SBuf, EnumType, SBufCaseInsensitiveLess> lookupTable_t;
+ typedef std::unordered_map<const SBuf, EnumType, Hasher> lookupTable_t;
lookupTable_t lookupTable;
EnumType invalidValue;
};