From eac3230a71683a820696ce245a10e2faac2a32ff Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Mon, 28 Aug 2023 00:39:21 +0800 Subject: [PATCH] ... --- include/pocketpy/str.h | 2 +- src/str.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pocketpy/str.h b/include/pocketpy/str.h index 8f78d98f..6bf518a0 100644 --- a/include/pocketpy/str.h +++ b/include/pocketpy/str.h @@ -73,7 +73,7 @@ struct Str{ Str escape(bool single_quote=true) const; int index(const Str& sub, int start=0) const; Str replace(const Str& old, const Str& new_, int count=-1) const; - std::vector split(Str sep) const; + std::vector split(const Str& sep) const; /*************unicode*************/ int _unicode_index_to_byte(int i) const; diff --git a/src/str.cpp b/src/str.cpp index 264f1f73..327be002 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -308,7 +308,7 @@ int utf8len(unsigned char c, bool suppress){ return _byte_index_to_unicode(size); } - std::vector Str::split(Str sep) const{ + std::vector Str::split(const Str& sep) const{ std::vector result; int start = 0; while(true){