@@ -1286,7 +1286,7 @@ int TClassEdit::GetSplit(const char *type, vector<string>& output, int &nestedLo
12861286// / CleanType(" A<B, C< D, E> > *,F,G>") returns "A<B,C<D,E> >*"
12871287// //////////////////////////////////////////////////////////////////////////
12881288
1289- string TClassEdit::CleanType (const char * typeDesc, int mode, const char **tail)
1289+ string TClassEdit::CleanType (std::string_view typeDesc, int mode, const char **tail)
12901290{
12911291 constexpr static std::array<const char *, 3 > remove{" class" , " const" , " volatile" };
12921292 constexpr static auto lengths = []() constexpr {
@@ -1297,12 +1297,13 @@ string TClassEdit::CleanType(const char *typeDesc, int mode, const char **tail)
12971297 }();
12981298
12991299 string result;
1300- result.reserve (strlen ( typeDesc)*2 );
1300+ result.reserve (typeDesc. size ( )*2 );
13011301 int kbl=1 ;
13021302 std::vector<char > parensStack;
1303- const char * c;
1303+ const char * c = nullptr ;
13041304
1305- for (c=typeDesc;*c;c++) {
1305+ for (auto i = 0u ; i < typeDesc.size (); ++i) {
1306+ c = typeDesc.data () + i;
13061307 if (std::isspace (c[0 ])) {
13071308 if (kbl) continue ;
13081309 if (!isalnum (c[ 1 ]) && c[ 1 ] !=' _' ) continue ;
@@ -1328,7 +1329,7 @@ string TClassEdit::CleanType(const char *typeDesc, int mode, const char **tail)
13281329 // make sure that the 'keyword' is not part of a longer indentifier
13291330 if (isalnum (c[rlen]) || c[rlen]==' _' || c[rlen]==' $' ) continue ;
13301331
1331- c+=rlen-1 ; done = 1 ; break ;
1332+ c+=rlen-1 ; i+=rlen- 1 ; done = 1 ; break ;
13321333 }
13331334 if (done) continue ;
13341335 }
0 commit comments