From f32bb83f9f6c79f342c4c2bc16d334d73aa7b45c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 17 Nov 2021 03:06:31 +0000 Subject: [PATCH] lcnagfmt --- .../chttp2/transport/hpack_parser.cc | 46 ++++++++++--------- src/core/lib/slice/slice.h | 3 +- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index b8c85435a11..b28ce481628 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -683,10 +683,12 @@ class HPackParser::String { return p->as_string_view(); } if (auto* p = absl::get_if>(&value_)) { - return absl::string_view(reinterpret_cast(p->data()), p->size()); + return absl::string_view(reinterpret_cast(p->data()), + p->size()); } if (auto* p = absl::get_if>(&value_)) { - return absl::string_view(reinterpret_cast(p->data()), p->size()); + return absl::string_view(reinterpret_cast(p->data()), + p->size()); } abort(); GPR_UNREACHABLE_CODE(return absl::string_view()); @@ -1240,30 +1242,30 @@ class HPackParser::Parser { }; Slice HPackParser::String::Take(Extern) { - if (auto* p = absl::get_if(&value_)) { - return std::move(*p); - } - if (auto* p = absl::get_if>(&value_)) { - return Slice::FromCopiedBuffer(*p); - } - if (auto* p = absl::get_if>(&value_)) { - return Slice::FromCopiedBuffer(*p); - } - abort(); - GPR_UNREACHABLE_CODE(return Slice()); + if (auto* p = absl::get_if(&value_)) { + return std::move(*p); + } + if (auto* p = absl::get_if>(&value_)) { + return Slice::FromCopiedBuffer(*p); + } + if (auto* p = absl::get_if>(&value_)) { + return Slice::FromCopiedBuffer(*p); + } + abort(); + GPR_UNREACHABLE_CODE(return Slice()); } Slice HPackParser::String::Take(Intern) { - ManagedMemorySlice m; + ManagedMemorySlice m; if (auto* p = absl::get_if(&value_)) { - m = ManagedMemorySlice(&p->c_slice()); - } - if (auto* p = absl::get_if>(&value_)) { - m = ManagedMemorySlice(reinterpret_cast(p->data()), p->size()); - } - if (auto* p = absl::get_if>(&value_)) { - m = ManagedMemorySlice(reinterpret_cast(p->data()), p->size()); - } + m = ManagedMemorySlice(&p->c_slice()); + } + if (auto* p = absl::get_if>(&value_)) { + m = ManagedMemorySlice(reinterpret_cast(p->data()), p->size()); + } + if (auto* p = absl::get_if>(&value_)) { + m = ManagedMemorySlice(reinterpret_cast(p->data()), p->size()); + } return Slice(m); } diff --git a/src/core/lib/slice/slice.h b/src/core/lib/slice/slice.h index 64d9ba2e0d8..e9302d88885 100644 --- a/src/core/lib/slice/slice.h +++ b/src/core/lib/slice/slice.h @@ -164,7 +164,8 @@ struct CopyConstructors { } template static Out FromCopiedBuffer(const Buffer& buffer) { - return Out(UnmanagedMemorySlice(reinterpret_cast(buffer.data()), buffer.size())); + return Out(UnmanagedMemorySlice( + reinterpret_cast(buffer.data()), buffer.size())); } };