From cad3f30b44c2bfac54ee82c6fc9e49ba49078620 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 24 Sep 2020 12:27:48 -0700 Subject: Export of internal Abseil changes -- 1d4582ea8b9f38bef580d1998ebeb56adca7d3fb by Abseil Team : Used StorageT alias to unify getters of CompressedTuple PiperOrigin-RevId: 333572002 -- a630f1ef375a621dd89e6908cc6980ba81448331 by Derek Mauro : Silence -Wrange-loop-analysis warnings These warnings are likely incorrect for small POD objects, and clang fixed this with https://reviews.llvm.org/D72212, but Xcode 12 enabled this buggy warning by default. This fixes this problem for these users. As a reminder, [we still recommend passing string_view by value for function parameters](https://abseil.io/tips/1) as it generates less code. Fixes #787 PiperOrigin-RevId: 333536667 GitOrigin-RevId: 1d4582ea8b9f38bef580d1998ebeb56adca7d3fb Change-Id: Ib17aa296f48f3f0fda566460a302979f5adf4195 --- absl/strings/internal/str_split_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'absl/strings/internal/str_split_internal.h') diff --git a/absl/strings/internal/str_split_internal.h b/absl/strings/internal/str_split_internal.h index 6f5bc095..49ec5392 100644 --- a/absl/strings/internal/str_split_internal.h +++ b/absl/strings/internal/str_split_internal.h @@ -336,7 +336,7 @@ class Splitter { Container operator()(const Splitter& splitter) const { Container c; auto it = std::inserter(c, c.end()); - for (const auto sp : splitter) { + for (const auto& sp : splitter) { *it++ = ValueType(sp); } return c; @@ -401,7 +401,7 @@ class Splitter { Container m; typename Container::iterator it; bool insert = true; - for (const auto sp : splitter) { + for (const auto& sp : splitter) { if (insert) { it = Inserter::Insert(&m, First(sp), Second()); } else { -- cgit v1.2.3