]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Remove the unused BoundsCheckingPointer class 10783/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 30 Sep 2021 15:35:14 +0000 (17:35 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 30 Sep 2021 15:35:14 +0000 (17:35 +0200)
pdns/dns.cc

index 4bdd409d80b64f88eee2225beb7b0795dde89f17..cd0ce26cc6020c00572f4a5b8d21b069f62ca981 100644 (file)
@@ -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)
 {