fix: Token::toString 缓存

This commit is contained in:
msojocs 2023-06-21 18:37:42 +08:00
parent 2a5e556538
commit 2d84ba10f0
2 changed files with 7 additions and 5 deletions

View File

@ -94,15 +94,16 @@ namespace WXML
std::string offset_0; // content std::string offset_0; // content
int offset_16; // pos int offset_16; // pos
int offset_20; // size int offset_20; // size
bool offset_28; bool offset_28; // hasCache toString
std::string offset_32; std::string offset_32; // chcheData toString
bool offset_84; bool offset_84; // hasCache attrContent
std::string offset_88; std::string offset_88; // chcheData attrContent
public: public:
Token(/* args */); Token(/* args */);
Token(WXML::DOMLib::Token&&); Token(WXML::DOMLib::Token&&);
Token(WXML::DOMLib::Token const&); Token(WXML::DOMLib::Token const&);
~Token(); ~Token();
std::string ToString(); std::string ToString();
/** /**

View File

@ -199,7 +199,8 @@ namespace WXML
std::string v4 = this->offset_32; std::string v4 = this->offset_32;
if (this->offset_0.size() > 0 && !this->offset_28) if (this->offset_0.size() > 0 && !this->offset_28)
{ {
v4 = this->offset_32.substr(this->offset_16, this->offset_20); v4 = this->offset_0.substr(this->offset_16, this->offset_20);
this->offset_32 = v4;
this->offset_28 = true; this->offset_28 = true;
} }
return v4; return v4;