summaryrefslogtreecommitdiff
path: root/modules/commands/os_oper.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-13 06:12:56 -0500
committerAdam <Adam@anope.org>2012-12-13 06:12:56 -0500
commitc1077faa281c5635f85b892e605e23bd6c8fcc3b (patch)
tree213b5f87a19f182e1efd6110f03ff10d5b10ebf6 /modules/commands/os_oper.cpp
parent76ba147c22944b67e8522cd2bb7b6e1bae498ced (diff)
Optimize much of the database code and serialize code.
Diffstat (limited to 'modules/commands/os_oper.cpp')
-rw-r--r--modules/commands/os_oper.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp
index 882455898..b014a1271 100644
--- a/modules/commands/os_oper.cpp
+++ b/modules/commands/os_oper.cpp
@@ -17,22 +17,23 @@ struct MyOper : Oper, Serializable
{
MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { }
- Serialize::Data Serialize() const anope_override
+ void Serialize(Serialize::Data &data) const anope_override
{
- Serialize::Data data;
-
data["name"] << this->name;
data["type"] << this->ot->GetName();
-
- return data;
}
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
{
- OperType *ot = OperType::Find(data["type"].astr());
+ Anope::string stype, sname;
+
+ data["type"] >> stype;
+ data["name"] >> sname;
+
+ OperType *ot = OperType::Find(stype);
if (ot == NULL)
return NULL;
- NickCore *nc = NickCore::Find(data["name"].astr());
+ NickCore *nc = NickCore::Find(sname);
if (nc == NULL)
return NULL;