From 854010bc34484a22f5e97ed21ea76e76cde6a9ca Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 11 Jun 2024 18:46:30 +0200 Subject: Merging upstream version 1.62.1. Signed-off-by: Daniel Baumann --- src/base64.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/base64.h') diff --git a/src/base64.h b/src/base64.h index 1bd51af..8789427 100644 --- a/src/base64.h +++ b/src/base64.h @@ -204,18 +204,19 @@ template std::string decode(InputIt first, InputIt last) { } template -StringRef decode(BlockAllocator &balloc, InputIt first, InputIt last) { +std::span decode(BlockAllocator &balloc, InputIt first, + InputIt last) { auto len = std::distance(first, last); if (len % 4 != 0) { - return StringRef::from_lit(""); + return {}; } auto iov = make_byte_ref(balloc, len / 4 * 3 + 1); - auto p = iov.base; + auto p = std::begin(iov); p = decode(first, last, p); *p = '\0'; - return StringRef{iov.base, p}; + return {std::begin(iov), p}; } } // namespace base64 -- cgit v1.2.3