summaryrefslogtreecommitdiff
path: root/include/users.h
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-19 20:34:14 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-19 20:34:14 +0000
commita67b9de1742efbff29ec08093b220565eab7df23 (patch)
tree1f0778b8e417fd24873b945f8d2e89a292a25942 /include/users.h
parente93827e41cdb958314eb669e94c9dd1280b691c9 (diff)
Change modes in channels and users to use std::bitset instead of an array. This saves 56 bytes per channel, and 112 bytes per channel, with no loss in speed or ease of use in code. :). Thanks (VERY) much to Special for telling me about this.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10043 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/users.h')
-rw-r--r--include/users.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/users.h b/include/users.h
index 39abc6309..503a1e568 100644
--- a/include/users.h
+++ b/include/users.h
@@ -17,7 +17,6 @@
#include "socket.h"
#include "connection.h"
#include "dns.h"
-
#include "mode.h"
/** Channel status for a user
@@ -534,20 +533,21 @@ class CoreExport User : public connection
std::string fullname;
/** The user's mode list.
- * This is NOT a null terminated string! In the 1.1 version of InspIRCd
- * this is an array of values in a similar way to channel modes.
- * A value of 1 in field (modeletter-65) indicates that the mode is
+ * NOT a null terminated string.
+ * Also NOT an array.
+ * Much love to the STL for giving us an easy to use bitset, saving us RAM.
+ * if (modes[modeletter-65]) is set, then the mode is
* set, for example, to work out if mode +s is set, we check the field
* User::modes['s'-65] != 0.
* The following RFC characters o, w, s, i have constants defined via an
* enum, such as UM_SERVERNOTICE and UM_OPETATOR.
*/
- unsigned char modes[64];
+ std::bitset<64> modes;
/** What snomasks are set on this user.
* This functions the same as the above modes.
*/
- unsigned char snomasks[64];
+ std::bitset<64> snomasks;
/** Channels this user is on, and the permissions they have there
*/