From bd0decab8278045e5dcbc252ae4099d27fede7a0 Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Tue, 26 Feb 2019 01:42:26 +0100 Subject: [PATCH] Ban absl::StrSplit and absl::StrJoin For binary size reasons; they emit too many instructions at each call site. I decided to not point out replacements for them, since rtc::join has only one caller, and rtc::split isn't the only option for splitting strings. And both of them have APIs that can cause the creation of needless temporary strings. Bug: none Change-Id: I06161012836a90b09249c2813d2ddc15f167d580 Notry: true Reviewed-on: https://webrtc-review.googlesource.com/c/124480 Commit-Queue: Karl Wiberg Reviewed-by: Steve Anton Reviewed-by: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#26846} --- abseil-in-webrtc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abseil-in-webrtc.md b/abseil-in-webrtc.md index 7739cfa120..d09ff1dc42 100644 --- a/abseil-in-webrtc.md +++ b/abseil-in-webrtc.md @@ -49,9 +49,9 @@ and avoid `absl::Span` until C++20 is finalized and the Abseil team has decided if they will change `absl::Span` to match. [Bug](https://bugs.webrtc.org/9214). -### `absl::StrCat` and `absl::StrAppend` +### `absl::StrCat`, `absl::StrAppend`, `absl::StrJoin`, `absl::StrSplit` -*Use `rtc::SimpleStringBuilder` instead.* +*Use `rtc::SimpleStringBuilder` to build strings.* These are optimized for speed, not binary size. Even `StrCat` calls with a modest number of arguments can easily add several hundred bytes