From 26ccae32112679c4653c1e3f8a1203c828bea05c Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 16 Feb 2023 10:28:44 -0800 Subject: Pass string views by value string_view should always be passed by value; This commit is a sed replace of the code to make all string_views pass by value, per general coding guidelines[1]. [1] https://quuxplusone.github.io/blog/2021/11/09/pass-string-view-by-value/ Tested: Code compiles. Signed-off-by: Ed Tanous Change-Id: I55b342a29a0fbfce0a4ed9ea63db6014d03b134c --- COMMON_ERRORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'COMMON_ERRORS.md') diff --git a/COMMON_ERRORS.md b/COMMON_ERRORS.md index 6cb7340bfd..aa4b042654 100644 --- a/COMMON_ERRORS.md +++ b/COMMON_ERRORS.md @@ -23,7 +23,7 @@ This pointer is not guaranteed to be filled, and could be a null dereference. ## 2. String views aren't null terminated ```cpp -int getIntFromString(const std::string_view s){ +int getIntFromString(std::string_view s){ return std::atoi(s.data()); } ``` -- cgit v1.2.3