summaryrefslogtreecommitdiff
path: root/absl/strings/string_view.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-08-06 06:19:26 -0700
committerGravatar dinord <dinor@google.com>2021-08-06 13:27:35 +0000
commitbf31a10b65d945665cecfb9d8807702ae4a7fde1 (patch)
tree19424ad3fe5f31790e792a6c99530012e84e5643 /absl/strings/string_view.h
parentab01e0403a40813857a8e580d9cf1580ba0c4139 (diff)
Export of internal Abseil changes
-- 93c607726d663800b4bfa472cba043fd3f5d0e97 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 389158822 -- 55b3bb50bbc168567c6ba25d07df2c2c39e864af by Martijn Vels <mvels@google.com>: Change CordRepRing alternative implementation to CordRepBtree alternative. This changes makes CordRepBtree (BTREE) the alternative to CordRepConcat (CONCAT) trees, enabled through the internal / experimental 'cord_btree_enabled' latch. PiperOrigin-RevId: 389030571 -- d6fc346143606c096bca8eb5029e4c429ac6e305 by Todd Lipcon <tlipcon@google.com>: Fix a small typo in SequenceLock doc comment PiperOrigin-RevId: 388972936 -- e46f9245dce8b4150e3ca2664e0cf42b75f90a83 by Martijn Vels <mvels@google.com>: Add 'shallow' validation mode to CordRepBtree which will be the default for internal assertions. PiperOrigin-RevId: 388753606 -- b5e74f163b490beb006f848ace67bb650433fe13 by Martijn Vels <mvels@google.com>: Add btree statistics to CordzInfo, and reduce rounding errors PiperOrigin-RevId: 388715878 -- 105bcbf80de649937e693b29b18220f9e6841a51 by Evan Brown <ezb@google.com>: Skip length checking when constructing absl::string_view from `const char*`. The length check causes unnecessary code bloat. PiperOrigin-RevId: 388271741 -- bed595158f24839efe49c65ae483f797d79fe0ae by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 387713428 GitOrigin-RevId: 93c607726d663800b4bfa472cba043fd3f5d0e97 Change-Id: I2a4840f5ffcd7f70b7d7d45cce66f23c42cf565f
Diffstat (limited to 'absl/strings/string_view.h')
-rw-r--r--absl/strings/string_view.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h
index ec6c431f..ea760526 100644
--- a/absl/strings/string_view.h
+++ b/absl/strings/string_view.h
@@ -198,9 +198,9 @@ class string_view {
// Implicit constructor of a `string_view` from NUL-terminated `str`. When
// accepting possibly null strings, use `absl::NullSafeStringView(str)`
// instead (see below).
+ // The length check is skipped since it is unnecessary and causes code bloat.
constexpr string_view(const char* str) // NOLINT(runtime/explicit)
- : ptr_(str),
- length_(str ? CheckLengthInternal(StrlenInternal(str)) : 0) {}
+ : ptr_(str), length_(str ? StrlenInternal(str) : 0) {}
// Implicit constructor of a `string_view` from a `const char*` and length.
constexpr string_view(const char* data, size_type len)