Skip to content

Commit eae4992

Browse files
committed
upd
1 parent f526800 commit eae4992

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ uint32_t su::getPow10(uint8_t value);
867867
- добавлен TextParser
868868
- добавлены стринг билдеры StringExt и StringStatic
869869
- 1.4.3 - Оптимизация сравнения, добавлено constexpr измерение длины строки
870+
- 1.4.7 - исправлен баг split для esp32
870871
871872
<a id="install"></a>
872873

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=StringUtils
2-
version=1.4.6
2+
version=1.4.7
33
author=AlexGyver <[email protected]>
44
maintainer=AlexGyver <[email protected]>
55
sentence=Bunch of converting functions for string data

src/utils/Text.h

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,22 @@ class Text : public Printable {
332332
uint16_t split(T* arr, uint16_t len, char div) const {
333333
if (!len || !length()) return 0;
334334
find_t f;
335-
while (!f.last) arr[f.count - 1] = _parse(div, 1, len, f);
335+
336+
while (!f.last) {
337+
Text txt = _parse(div, 1, len, f);
338+
arr[f.count - 1] = txt;
339+
}
336340
return f.count;
337341
}
338342

339343
template <typename T>
340344
uint16_t split(T** arr, uint16_t len, char div) const {
341345
if (!len || !length()) return 0;
342346
find_t f;
343-
while (!f.last) *(arr[f.count - 1]) = _parse(div, 1, len, f);
347+
while (!f.last) {
348+
Text txt = _parse(div, 1, len, f);
349+
*(arr[f.count - 1]) = txt;
350+
}
344351
return f.count;
345352
}
346353

@@ -356,15 +363,21 @@ class Text : public Printable {
356363
uint16_t split(T* arr, uint16_t len, const Text& div) const {
357364
if (!len || !length() || !div.length() || div._len > _len) return 0;
358365
find_t f;
359-
while (!f.last) arr[f.count - 1] = _parse(div, div._len, len, f);
366+
while (!f.last) {
367+
Text txt = _parse(div, div._len, len, f);
368+
arr[f.count - 1] = txt;
369+
}
360370
return f.count;
361371
}
362372

363373
template <typename T>
364374
uint16_t split(T** arr, uint16_t len, const Text& div) const {
365375
if (!len || !length() || !div.length() || div._len > _len) return 0;
366376
find_t f;
367-
while (!f.last) *(arr[f.count - 1]) = _parse(div, div._len, len, f);
377+
while (!f.last) {
378+
Text txt = _parse(div, div._len, len, f);
379+
*(arr[f.count - 1]) = txt;
380+
}
368381
return f.count;
369382
}
370383

0 commit comments

Comments
 (0)