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