From da652fe63ebcdcea703329e6d9247b32ccbf3384 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Tue, 5 Dec 2017 21:24:16 +0100 Subject: [PATCH] BITSTORE_H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit moveLeft eines kompletten Puffers bei dem keine Daten übrig bleiben optimiert. #62 --- src/_micro-api/libraries/bitstore/src/bitstore.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/_micro-api/libraries/bitstore/src/bitstore.h b/src/_micro-api/libraries/bitstore/src/bitstore.h index fb2dddb0..22325238 100644 --- a/src/_micro-api/libraries/bitstore/src/bitstore.h +++ b/src/_micro-api/libraries/bitstore/src/bitstore.h @@ -209,7 +209,11 @@ template bool BitStore::moveLeft(const uint16_t begin) { if (begin == 0 || begin >= valcount) return false; - + if (begin == valcount - 1) + { + reset(); + return true; + } uint8_t startbyte = begin*valuelen / 8; byte crcval = this->getValue(begin);