mirror of https://github.com/FOME-Tech/fome-fw.git
tiny improvement
This commit is contained in:
parent
eabffe02d4
commit
5cf540a8f0
|
@ -82,19 +82,11 @@ void append(Logging *logging, const char *text) {
|
||||||
* @note This method if fast because it does not validate much, be sure what you are doing
|
* @note This method if fast because it does not validate much, be sure what you are doing
|
||||||
*/
|
*/
|
||||||
void appendFast(Logging *logging, const char *text) {
|
void appendFast(Logging *logging, const char *text) {
|
||||||
// todo: fix this implementation? this would be a one-pass implementation instead of a two-pass
|
|
||||||
|
|
||||||
register char *s;
|
register char *s;
|
||||||
for (s = (char *) text; *s; ++s)
|
|
||||||
;
|
|
||||||
int extraLen = (s - text);
|
|
||||||
|
|
||||||
s = logging->linePointer;
|
s = logging->linePointer;
|
||||||
while ((*s++ = *text++) != 0)
|
while ((*s++ = *text++) != 0)
|
||||||
;
|
;
|
||||||
|
logging->linePointer = s - 1;
|
||||||
// strcpy(logging->linePointer, text);
|
|
||||||
logging->linePointer += extraLen;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: look into chsnprintf once on Chibios 3
|
// todo: look into chsnprintf once on Chibios 3
|
||||||
|
|
Loading…
Reference in New Issue