summaryrefslogtreecommitdiff
path: root/modules/commands/hs_request.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/hs_request.cpp
parent76ba147c22944b67e8522cd2bb7b6e1bae498ced (diff)
Optimize much of the database code and serialize code.
Diffstat (limited to 'modules/commands/hs_request.cpp')
-rw-r--r--modules/commands/hs_request.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp
index c7cd75c11..6cd2e6811 100644
--- a/modules/commands/hs_request.cpp
+++ b/modules/commands/hs_request.cpp
@@ -32,21 +32,20 @@ struct HostRequest : ExtensibleItem, Serializable
HostRequest() : Serializable("HostRequest") { }
- Serialize::Data Serialize() const anope_override
+ void Serialize(Serialize::Data &data) const anope_override
{
- Serialize::Data data;
-
data["nick"] << this->nick;
data["ident"] << this->ident;
data["host"] << this->host;
- data["time"].SetType(Serialize::DT_INT) << this->time;
-
- return data;
+ data.SetType("time", Serialize::Data::DT_INT); data["time"] << this->time;
}
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
{
- NickAlias *na = NickAlias::Find(data["nick"].astr());
+ Anope::string snick;
+ data["nick"] >> snick;
+
+ NickAlias *na = NickAlias::Find(snick);
if (na == NULL)
return NULL;