diff options
author | goerch <jhr.walter@t-online.de> | 2023-08-22 23:10:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-23 00:10:42 +0300 |
commit | 46ef5b5fcf4c366e1fb27726b6394adbbf8fd0ea (patch) | |
tree | 96f771ef97596af6e59bdcfeea76d15a7c80153f /tests/test-tokenizer-1.cpp | |
parent | c63bb1d16a70c03440671b76954bb767513cead8 (diff) |
llama : fix whitespace escaping in tokenizer (#2724)
Diffstat (limited to 'tests/test-tokenizer-1.cpp')
-rw-r--r-- | tests/test-tokenizer-1.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/test-tokenizer-1.cpp b/tests/test-tokenizer-1.cpp index d8db7cd9..993d17f1 100644 --- a/tests/test-tokenizer-1.cpp +++ b/tests/test-tokenizer-1.cpp @@ -11,18 +11,11 @@ #include <locale> static std::string escape_whitespace(const std::string& text) { - std::string result; - bool escaping = false; - result += "\xe2\x96\x81"; + std::string result = "\xe2\x96\x81"; for (size_t offs = 0; offs < text.length(); ++offs) { if (text[offs] == ' ') { - if (!escaping) { - result += "\xe2\x96\x81"; - escaping = true; - } - } - else { - escaping = false; + result += "\xe2\x96\x81"; + } else { result += text[offs]; } } |