blueloveTH 2 лет назад
Родитель
Сommit
eac3230a71
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      include/pocketpy/str.h
  2. 1 1
      src/str.cpp

+ 1 - 1
include/pocketpy/str.h

@@ -73,7 +73,7 @@ struct Str{
     Str escape(bool single_quote=true) const;
     Str escape(bool single_quote=true) const;
     int index(const Str& sub, int start=0) const;
     int index(const Str& sub, int start=0) const;
     Str replace(const Str& old, const Str& new_, int count=-1) const;
     Str replace(const Str& old, const Str& new_, int count=-1) const;
-    std::vector<std::string_view> split(Str sep) const;
+    std::vector<std::string_view> split(const Str& sep) const;
 
 
     /*************unicode*************/
     /*************unicode*************/
     int _unicode_index_to_byte(int i) const;
     int _unicode_index_to_byte(int i) const;

+ 1 - 1
src/str.cpp

@@ -308,7 +308,7 @@ int utf8len(unsigned char c, bool suppress){
         return _byte_index_to_unicode(size);
         return _byte_index_to_unicode(size);
     }
     }
 
 
-    std::vector<std::string_view> Str::split(Str sep) const{
+    std::vector<std::string_view> Str::split(const Str& sep) const{
         std::vector<std::string_view> result;
         std::vector<std::string_view> result;
         int start = 0;
         int start = 0;
         while(true){
         while(true){