aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorQrchackOfficial <qrchackofficial@gmail.com>2017-06-05 01:52:55 +0200
committerShadowNinja <shadowninja@minetest.net>2017-06-10 21:04:47 -0400
commit5cc8ad946efb3612eb6ea8655780b29fe4c62e19 (patch)
treed0edc2fa46e654e7443bedba942b1ec77ac4fef5 /src/util
parent7bfd53ba587a1be71c1f8b3ebc3208d59f4da9c1 (diff)
downloadminetest-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.h6
-rw-r--r--src/util/srp.cpp2
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) {