From a26fc02d1ea9a2f0770c1297db0a049b9dd4b941 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Thu, 16 Mar 2023 17:32:09 -0400 Subject: Prefer copy_n and fill_n over copy and fill where appropriate. This lets us avoid having to do the addition manually. --- absl/time/internal/cctz/src/time_zone_fixed.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'absl/time') diff --git a/absl/time/internal/cctz/src/time_zone_fixed.cc b/absl/time/internal/cctz/src/time_zone_fixed.cc index f2b3294e..e09654ea 100644 --- a/absl/time/internal/cctz/src/time_zone_fixed.cc +++ b/absl/time/internal/cctz/src/time_zone_fixed.cc @@ -105,7 +105,7 @@ std::string FixedOffsetToName(const seconds& offset) { offset_minutes %= 60; const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1; char buf[prefix_len + sizeof("-24:00:00")]; - char* ep = std::copy(kFixedZonePrefix, kFixedZonePrefix + prefix_len, buf); + char* ep = std::copy_n(kFixedZonePrefix, prefix_len, buf); *ep++ = sign; ep = Format02d(ep, offset_hours); *ep++ = ':'; -- cgit v1.2.3