def delete(key)
      hashed_key = hash_key(key)
      unless (entry = @btree.get(hashed_key))
        return nil
      end

      if entry.is_a?(PEROBS::Array)
        entry.each_with_index do |ae, i|
          if ae.key == key
            self.entry_counter -= 1
            return entry.delete_at(i).value
          end
        end
      else
        return entry.value if entry.key == key
      end

      nil
    end
def delete(key)
      hashed_key = hash_key(key)
      unless (entry = @btree.get(hashed_key))
        return nil
      end

      if entry.is_a?(PEROBS::Array)
        entry.each_with_index do |ae, i|
          if ae.key == key
            self.entry_counter -= 1
            return entry.delete_at(i).value
          end
        end
      else
        return entry.value if entry.key == key
      end

      nil
    end
Delete and return the entry for the given key. Return nil if no matching
 entry exists.
 @param key [Integer or String]
 @return [Object] Deleted entry