@@ -1109,6 +1109,10 @@ namespace wiz {
1109
1109
size_t item_count = 0 ;
1110
1110
ArrayStack<WIZ_STRING_TYPE> operandStack;
1111
1111
1112
+ if (temp.GetItemListSize () > 0 ) {
1113
+ operandStack.reserve (temp.GetItemListSize ());
1114
+ }
1115
+
1112
1116
for (size_t i = 0 ; i < temp.GetIListSize (); ++i) {
1113
1117
if (i > 0 ) {
1114
1118
result += " " ;
@@ -1122,7 +1126,9 @@ namespace wiz {
1122
1126
else {
1123
1127
if (!String::startsWith (temp.GetUserTypeList (user_count)->GetName (), " $" )) {
1124
1128
if (!temp.GetUserTypeList (user_count)->GetName ().empty ()) {
1125
- result += " " + temp.GetUserTypeList (user_count)->GetName () + " = { " ;
1129
+ result += " " ;
1130
+ result += temp.GetUserTypeList (user_count)->GetName ();
1131
+ result += " = { " ;
1126
1132
}
1127
1133
else {
1128
1134
result += " { " ;
@@ -1150,6 +1156,10 @@ namespace wiz {
1150
1156
if (String::startsWith (temp.GetName (), " $" ) && temp.GetName ().size () > 1 ) {
1151
1157
wiz::ArrayStack<WIZ_STRING_TYPE> _stack;
1152
1158
1159
+ if (!operandStack.empty ()) {
1160
+ _stack.reserve (operandStack.size ());
1161
+ }
1162
+
1153
1163
while (operandStack.empty () == false ) {
1154
1164
_stack.push (operandStack.pop ());
1155
1165
}
@@ -1170,15 +1180,26 @@ namespace wiz {
1170
1180
{
1171
1181
WIZ_STRING_TYPE result;
1172
1182
if (temp.GetName ().empty () == false ) {
1173
- result += temp.GetName () + " = " ;
1183
+ result += temp.GetName ();
1184
+ result += " = " ;
1185
+ }
1186
+
1187
+ int count = 0 ;
1188
+ auto temp_val = temp.Get ();
1189
+
1190
+ if (auto x = temp_val.find (' /' ); x != std::string::npos) {
1191
+ count++;
1174
1192
}
1175
1193
1176
- auto tokens = tokenize (temp. Get () , ' /' );
1194
+ auto tokens_pre = tokenize_pre (temp_val , ' /' );
1177
1195
1178
- if (tokens. size () <= 1 ) {
1179
- return result + ToBool4 (now, global, temp. Get () , executeData);
1196
+ if (tokens_pre <= 1 ) {
1197
+ return result + ToBool4 (now, global, temp_val , executeData);
1180
1198
}
1181
-
1199
+
1200
+ auto tokens = tokenize (temp_val, ' /' );
1201
+
1202
+
1182
1203
WIZ_STRING_TYPE _result = " /" ;
1183
1204
1184
1205
for (int i = 0 ; i < tokens.size (); ++i) {
@@ -1197,17 +1218,17 @@ namespace wiz {
1197
1218
1198
1219
WIZ_STRING_TYPE LoadData::ToBool4 (wiz::load_data::UserType* now, wiz::load_data::UserType& global, const std::string& temp, const ExecuteData& executeData) {
1199
1220
std::string result;
1200
- if (String::startsWith (temp, " $local." )) {
1221
+ if (String::startsWith (temp, " $local." sv )) {
1201
1222
if (!(result = FindLocals (executeData.info .locals , temp)).empty ()) {
1202
1223
return result;
1203
1224
}
1204
1225
}
1205
- else if (String::startsWith (temp, " $parameter." )) {
1226
+ else if (String::startsWith (temp, " $parameter." sv )) {
1206
1227
if (!(result = FindParameters (executeData.info .parameters , temp)).empty ()) {
1207
1228
return result;
1208
1229
}
1209
1230
}
1210
- else if (String::startsWith (temp, " /" ) && temp.size () > 1 ) {
1231
+ else if (String::startsWith (temp, " /" sv ) && temp.size () > 1 ) {
1211
1232
if (!(result = Find (&global, temp)).empty ()) {
1212
1233
return result;
1213
1234
}
0 commit comments