diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2020-04-09 01:55:35 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2020-04-09 01:55:35 +0000 |
commit | cd024ff37bc5950173e4c7f34f7259d85825e810 (patch) | |
tree | 24e26b52391d78c7c7b65168aca8f803fde926b1 /googletest/samples/sample2.h | |
parent | 83481c8c5c0cd0b3fc86f39b2985efd4e300200a (diff) |
Notes
Diffstat (limited to 'googletest/samples/sample2.h')
-rw-r--r-- | googletest/samples/sample2.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/googletest/samples/sample2.h b/googletest/samples/sample2.h index 58f360f45c76..e9a5a7050b7d 100644 --- a/googletest/samples/sample2.h +++ b/googletest/samples/sample2.h @@ -50,15 +50,15 @@ class MyString { // C'tors // The default c'tor constructs a NULL string. - MyString() : c_string_(NULL) {} + MyString() : c_string_(nullptr) {} // Constructs a MyString by cloning a 0-terminated C string. - explicit MyString(const char* a_c_string) : c_string_(NULL) { + explicit MyString(const char* a_c_string) : c_string_(nullptr) { Set(a_c_string); } // Copy c'tor - MyString(const MyString& string) : c_string_(NULL) { + MyString(const MyString& string) : c_string_(nullptr) { Set(string.c_string_); } @@ -71,9 +71,7 @@ class MyString { // Gets the 0-terminated C string this MyString object represents. const char* c_string() const { return c_string_; } - size_t Length() const { - return c_string_ == NULL ? 0 : strlen(c_string_); - } + size_t Length() const { return c_string_ == nullptr ? 0 : strlen(c_string_); } // Sets the 0-terminated C string this MyString object represents. void Set(const char* c_string); |