Removed redundant range check in MemoryPoolPrint

This commit is contained in:
Benoit Blanchon
2021-04-18 16:47:28 +02:00
parent 2a777a659a
commit 64e52e97ee
2 changed files with 47 additions and 19 deletions

View File

@ -215,10 +215,8 @@ class MemoryPoolPrint : public Print {
}
const char* c_str() {
if (_size >= _capacity)
return 0;
_string[_size++] = 0; // TODO: test overflow
_string[_size++] = 0;
ARDUINOJSON_ASSERT(_size <= _capacity);
return _pool->saveStringFromFreeZone(_size);
}