From 3886751662901df642438c82092396af50d62285 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 28 Mar 2026 19:45:07 -1000 Subject: [PATCH] [api] Restore comment on __restrict__ local in encode_varint_raw_64 --- esphome/components/api/proto.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 48b450e8195..3989c7c424a 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -224,6 +224,8 @@ class ProtoWriteBuffer { this->encode_varint_raw_slow_(value); } void encode_varint_raw_64(uint64_t value) { + // Use __restrict__ so the compiler knows pos doesn't alias this-> + // and can keep it in a register across the loop. uint8_t *__restrict__ pos = this->pos_; while (value > 0x7F) { *pos++ = static_cast(value | 0x80);