From ce8f79507f5cd5c60acd633a7326ffb447100064 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 30 Sep 2021 17:35:14 +0200 Subject: [PATCH] Remove the unused BoundsCheckingPointer class --- pdns/dns.cc | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/pdns/dns.cc b/pdns/dns.cc index 4bdd409d80..cd0ce26cc6 100644 --- a/pdns/dns.cc +++ b/pdns/dns.cc @@ -79,30 +79,6 @@ std::string Opcode::to_s(uint8_t opcode) { return s_opcodes.at(opcode); } -class BoundsCheckingPointer -{ -public: - explicit BoundsCheckingPointer(const char* a, size_t length) - : d_ptr(a), d_length(length) - {} - - explicit BoundsCheckingPointer(const std::string& str) - : d_ptr(str.c_str()), d_length(str.size()) - {} - - - char operator[](size_t offset) const - { - if(offset < d_length) - return d_ptr[offset]; - throw runtime_error("out of bounds: "+std::to_string(offset)+" >= " + std::to_string(d_length)); - } -private: - const char* d_ptr; - const size_t d_length; -}; - - // goal is to hash based purely on the question name, and turn error into 'default' uint32_t hashQuestion(const char* packet, uint16_t len, uint32_t init) { -- 2.47.2