diff options
author | QrchackOfficial <qrchackofficial@gmail.com> | 2017-06-05 01:52:55 +0200 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2017-06-10 21:04:47 -0400 |
commit | 5cc8ad946efb3612eb6ea8655780b29fe4c62e19 (patch) | |
tree | d0edc2fa46e654e7443bedba942b1ec77ac4fef5 /src/util | |
parent | 7bfd53ba587a1be71c1f8b3ebc3208d59f4da9c1 (diff) | |
download | minetest-5cc8ad946efb3612eb6ea8655780b29fe4c62e19.tar.gz minetest-5cc8ad946efb3612eb6ea8655780b29fe4c62e19.tar.bz2 minetest-5cc8ad946efb3612eb6ea8655780b29fe4c62e19.zip |
Remove superfluous pointer null checks
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/pointer.h | 6 | ||||
-rw-r--r-- | src/util/srp.cpp | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/util/pointer.h b/src/util/pointer.h index 6614ca2c2..f68269882 100644 --- a/src/util/pointer.h +++ b/src/util/pointer.h @@ -97,8 +97,7 @@ public: private: void drop() { - if(data) - delete[] data; + delete[] data; } T *data; unsigned int m_size; @@ -214,8 +213,7 @@ private: (*refcount)--; if(*refcount == 0) { - if(data) - delete[] data; + delete[] data; delete refcount; } } diff --git a/src/util/srp.cpp b/src/util/srp.cpp index 430ba1137..e0ddb9020 100644 --- a/src/util/srp.cpp +++ b/src/util/srp.cpp @@ -861,7 +861,7 @@ err_exit: mpz_clear(usr->a); mpz_clear(usr->A); mpz_clear(usr->S); - if (usr->ng) delete_ng(usr->ng); + delete_ng(usr->ng); srp_free(usr->username); srp_free(usr->username_verifier); if (usr->password) { |