summaryrefslogtreecommitdiff
path: root/absl/strings/substitute.cc
diff options
context:
space:
mode:
authorGravatar Dmitri Gribenko <dmitrig@google.com>2023-12-11 09:07:07 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2023-12-11 09:07:59 -0800
commit55621d1af55be7bf9a2c8e5dcef4368d9a6d4e51 (patch)
tree4c0e74b9a45b8875e35ee543089315a0d9989df1 /absl/strings/substitute.cc
parentfad946221cec37175e762c399760f54b9de9a9fa (diff)
Add nullability annotations
PiperOrigin-RevId: 589842893 Change-Id: I9657761d1f71c665582406f278c6605f6d382f6d
Diffstat (limited to 'absl/strings/substitute.cc')
-rw-r--r--absl/strings/substitute.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/absl/strings/substitute.cc b/absl/strings/substitute.cc
index 354c070d..dd32c75f 100644
--- a/absl/strings/substitute.cc
+++ b/absl/strings/substitute.cc
@@ -22,6 +22,7 @@
#include "absl/base/config.h"
#include "absl/base/internal/raw_logging.h"
+#include "absl/base/nullability.h"
#include "absl/strings/ascii.h"
#include "absl/strings/escaping.h"
#include "absl/strings/internal/resize_uninitialized.h"
@@ -33,9 +34,9 @@ namespace absl {
ABSL_NAMESPACE_BEGIN
namespace substitute_internal {
-void SubstituteAndAppendArray(std::string* output, absl::string_view format,
- const absl::string_view* args_array,
- size_t num_args) {
+void SubstituteAndAppendArray(
+ absl::Nonnull<std::string*> output, absl::string_view format,
+ absl::Nullable<const absl::string_view*> args_array, size_t num_args) {
// Determine total size needed.
size_t size = 0;
for (size_t i = 0; i < format.size(); i++) {
@@ -104,7 +105,7 @@ void SubstituteAndAppendArray(std::string* output, absl::string_view format,
assert(target == output->data() + output->size());
}
-Arg::Arg(const void* value) {
+Arg::Arg(absl::Nullable<const void*> value) {
static_assert(sizeof(scratch_) >= sizeof(value) * 2 + 2,
"fix sizeof(scratch_)");
if (value == nullptr) {