summaryrefslogtreecommitdiff
path: root/modules/commands/ns_set_misc.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/ns_set_misc.cpp
parent76ba147c22944b67e8522cd2bb7b6e1bae498ced (diff)
Optimize much of the database code and serialize code.
Diffstat (limited to 'modules/commands/ns_set_misc.cpp')
-rw-r--r--modules/commands/ns_set_misc.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/commands/ns_set_misc.cpp b/modules/commands/ns_set_misc.cpp
index 1e088a425..b6dd672a3 100644
--- a/modules/commands/ns_set_misc.cpp
+++ b/modules/commands/ns_set_misc.cpp
@@ -23,20 +23,22 @@ struct NSMiscData : ExtensibleItem, Serializable
{
}
- Serialize::Data Serialize() const anope_override
+ void Serialize(Serialize::Data &sdata) const anope_override
{
- Serialize::Data sdata;
-
sdata["nc"] << this->nc->display;
sdata["name"] << this->name;
sdata["data"] << this->data;
-
- return sdata;
}
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
{
- NickCore *nc = NickCore::Find(data["nc"].astr());
+ Anope::string snc, sname, sdata;
+
+ data["nc"] >> snc;
+ data["name"] >> sname;
+ data["data"] >> sdata;
+
+ NickCore *nc = NickCore::Find(snc);
if (nc == NULL)
return NULL;
@@ -50,8 +52,8 @@ struct NSMiscData : ExtensibleItem, Serializable
}
else
{
- d = new NSMiscData(nc, data["name"].astr(), data["data"].astr());
- nc->Extend(data["name"].astr(), d);
+ d = new NSMiscData(nc, sname, sdata);
+ nc->Extend(sname, d);
}
return d;