Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 8b95f10

Browse files
committed
MessageChain性能提升;
1 parent bfd252d commit 8b95f10

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

include/defs/message_chain.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,17 @@ namespace Cyan
118118

119119
MessageChain& At(const QQ_t qq)
120120
{
121-
return this->Add(AtMessage(qq));
121+
return this->Add<AtMessage>(qq);
122122
}
123123

124124
MessageChain& AtAll()
125125
{
126-
return this->Add(AtAllMessage());
126+
return this->Add<AtAllMessage>();
127127
}
128128

129129
MessageChain& Face(int faceID)
130130
{
131-
return this->Add(FaceMessage(faceID));
131+
return this->Add<FaceMessage>(faceID);
132132
}
133133

134134
MessageChain& Face(const string& name)
@@ -140,45 +140,45 @@ namespace Cyan
140140

141141
MessageChain& Plain(const string& plainText)
142142
{
143-
return this->Add(PlainMessage(plainText));
143+
return this->Add<PlainMessage>(plainText);
144144
}
145145

146146
template<typename T>
147147
MessageChain& Plain(const T& val)
148148
{
149149
std::stringstream ss;
150150
ss << val;
151-
return this->Add(PlainMessage(ss.str()));
151+
return this->Add<PlainMessage>(ss.str());
152152
}
153153

154154
MessageChain& Image(const MiraiImage& Image)
155155
{
156-
return this->Add(ImageMessage(Image));
156+
return this->Add<ImageMessage>(Image);
157157
}
158158

159159
MessageChain& FlashImage(const MiraiImage& Image)
160160
{
161-
return this->Add(FlashImageMessage(Image));
161+
return this->Add<FlashImageMessage>(Image);
162162
}
163163

164164
MessageChain& Xml(const string& xml_str)
165165
{
166-
return this->Add(XmlMessage(xml_str));
166+
return this->Add<XmlMessage>(xml_str);
167167
}
168168

169169
MessageChain& Json(const string& json_str)
170170
{
171-
return this->Add(JsonMessage(json_str));
171+
return this->Add<JsonMessage>(json_str);
172172
}
173173

174174
MessageChain& App(const string& app_str)
175175
{
176-
return this->Add(AppMessage(app_str));
176+
return this->Add<AppMessage>(app_str);
177177
}
178178

179179
MessageChain& Poke(PokeType poke)
180180
{
181-
return this->Add(PokeMessage(poke));
181+
return this->Add<PokeMessage>(poke);
182182
}
183183

184184
string GetPlainText() const;

0 commit comments

Comments
 (0)