From cb243f78caceec3ee51902def4661b9e428f1ebf Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 11 Jan 2022 17:42:56 +0000 Subject: [PATCH] Updated bit_cast --- include/etl/bit.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/include/etl/bit.h b/include/etl/bit.h index 844456d0..b8e57f06 100644 --- a/include/etl/bit.h +++ b/include/etl/bit.h @@ -58,14 +58,7 @@ namespace etl { TDestination destination; - const char* s = &source; - char* d = &destination; - char* const de = d + sizeof(TDestination); - - while (d != de) - { - *d++ = *s++; - } + memcpy(&destination, &source, sizeof(TDestination)); return destination; }