diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-12 20:30:45 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-12 20:30:45 +0000 |
commit | 9c70fbb7c7c532baf0e02e144e93d259b13913dd (patch) | |
tree | aec584affd5103b0ec6cfda572fafd6282756669 | |
parent | 194838af39aa5fc823571afe9d61b2453573a32d (diff) |
Optimized some static structs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1370 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/connection.h | 8 | ||||
-rw-r--r-- | src/dnsqueue.cpp | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/include/connection.h b/include/connection.h index b9be696fe..c6adedf26 100644 --- a/include/connection.h +++ b/include/connection.h @@ -73,7 +73,7 @@ class ircd_connector : public Extensible /** State. STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND * STATE_SYNC, STATE_DISCONNECTED, STATE_CONNECTED */ - int state; + char state; /** PRIVATE function to set the host address and port to connect to */ @@ -250,7 +250,7 @@ class connection : public Extensible /** Used by userrec to indicate the registration status of the connection */ - short int registered; + char registered; /** Time the connection was last pinged */ @@ -268,10 +268,6 @@ class connection : public Extensible */ time_t nping; - //char internal_addr[MAXBUF]; - - //int internal_port; - /** With a serverrec, this is a list of all established server connections. * With a userrec this is unused. */ diff --git a/src/dnsqueue.cpp b/src/dnsqueue.cpp index f00c9e25d..c05b12549 100644 --- a/src/dnsqueue.cpp +++ b/src/dnsqueue.cpp @@ -254,7 +254,7 @@ public: } }; -Lookup dnsq[MAXBUF]; +Lookup dnsq[255]; bool lookup_dns(std::string nick) { @@ -267,7 +267,7 @@ bool lookup_dns(std::string nick) Lookup L; if (L.DoLookup(nick)) { - for (int j = 0; j < MAXBUF; j++) + for (int j = 0; j < 255; j++) { if (!dnsq[j].GetFD()) { @@ -276,7 +276,7 @@ bool lookup_dns(std::string nick) } } // calculate the maximum value, this saves cpu time later - for (int p = 0; p < MAXBUF; p++) + for (int p = 0; p < 255; p++) if (dnsq[p].GetFD()) max_fd_alloc = p; } @@ -304,7 +304,7 @@ void dns_poll() } // looks like someones freed an item, recalculate end of list. if ((!dnsq[max_fd_alloc].GetFD()) && (max_fd_alloc != 0)) - for (int p = 0; p < MAXBUF; p++) + for (int p = 0; p < 255; p++) if (dnsq[p].GetFD()) max_fd_alloc = p; |