File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -236,28 +236,27 @@ GUITable* GUIFormSpecMenu::getTable(std::wstring tablename)
236
236
return 0 ;
237
237
}
238
238
239
- std::vector<std::string> split (const std::string &s, char delim) {
239
+ static std::vector<std::string> split (const std::string &s, char delim)
240
+ {
240
241
std::vector<std::string> tokens;
241
242
242
243
std::string current = " " ;
243
244
bool last_was_escape = false ;
244
- for (unsigned int i=0 ; i < s.size (); i++) {
245
+ for (unsigned int i = 0 ; i < s.size (); i++) {
246
+ char si = s.c_str ()[i];
245
247
if (last_was_escape) {
246
248
current += ' \\ ' ;
247
- current += s. c_str ()[i] ;
249
+ current += si ;
248
250
last_was_escape = false ;
249
- }
250
- else {
251
- if (s.c_str ()[i] == delim) {
251
+ } else {
252
+ if (si == delim) {
252
253
tokens.push_back (current);
253
254
current = " " ;
254
255
last_was_escape = false ;
255
- }
256
- else if (s.c_str ()[i] == ' \\ ' ){
256
+ } else if (si == ' \\ ' ) {
257
257
last_was_escape = true ;
258
- }
259
- else {
260
- current += s.c_str ()[i];
258
+ } else {
259
+ current += si;
261
260
last_was_escape = false ;
262
261
}
263
262
}
You can’t perform that action at this time.
0 commit comments