From 1c52b90e826ca3fdef6d55fccd7abbc4fdd90574 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 18 Dec 2006 18:35:25 +0000 Subject: Refactor dns.cpp to use an array of request types rather than map, for O(1) lookup time git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6042 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/dns.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/dns.h b/include/dns.h index 4087e2476..038323a43 100644 --- a/include/dns.h +++ b/include/dns.h @@ -86,16 +86,6 @@ class DNSHeader; */ class ResourceRecord; -/** - * A set of requests keyed by request id - */ -typedef std::map requestlist; - -/** - * An iterator into a set of requests - */ -typedef requestlist::iterator requestlist_iter; - /** * Query and resource record types */ @@ -254,11 +244,6 @@ class DNS : public EventHandler */ static const int MAX_REQUEST_ID = 0xFFFF; - /** - * Requests that are currently 'in flight' - */ - requestlist requests; - /** * Server address being used currently */ @@ -287,6 +272,10 @@ class DNS : public EventHandler * Currently active Resolver classes */ Resolver* Classes[MAX_REQUEST_ID]; + /** + * Requests that are currently 'in flight' + */ + DNSRequest* requests[MAX_REQUEST_ID]; /** * The port number DNS requests are made on, * and replies have as a source-port number. -- cgit v1.2.3