From cba90d630177ce6c57b5537e74ef3eab4e9c1ea2 Mon Sep 17 00:00:00 2001 From: George Marques Date: Sun, 28 Feb 2021 16:52:06 -0300 Subject: Update clang-format to version 11 This is taken from the Godot repository, so formatting is similar. This updates the style rules as well. Also fix style in files to conform with this version. --- include/core/Ref.hpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'include/core/Ref.hpp') diff --git a/include/core/Ref.hpp b/include/core/Ref.hpp index 80133a1..79bb1a8 100644 --- a/include/core/Ref.hpp +++ b/include/core/Ref.hpp @@ -19,7 +19,6 @@ class Ref { T *reference = nullptr; void ref(const Ref &p_from) { - if (p_from.reference == reference) return; @@ -31,7 +30,6 @@ class Ref { } void ref_pointer(T *p_ref) { - ERR_FAIL_COND(p_ref == nullptr); if (p_ref->init_ref()) @@ -40,44 +38,35 @@ class Ref { public: inline bool operator<(const Ref &p_r) const { - return reference < p_r.reference; } inline bool operator==(const Ref &p_r) const { - return reference == p_r.reference; } inline bool operator!=(const Ref &p_r) const { - return reference != p_r.reference; } inline T *operator->() { - return reference; } inline T *operator*() { - return reference; } inline const T *operator->() const { - return reference; } inline const T *ptr() const { - return reference; } inline T *ptr() { - return reference; } inline const T *operator*() const { - return reference; } @@ -88,7 +77,6 @@ public: } void operator=(const Ref &p_from) { - ref(p_from); } @@ -118,7 +106,6 @@ public: } Ref(const Ref &p_from) { - reference = nullptr; ref(p_from); } @@ -138,7 +125,6 @@ public: } Ref(T *p_reference) { - if (p_reference) ref_pointer(p_reference); else @@ -146,7 +132,6 @@ public: } Ref(const Variant &p_variant) { - reference = nullptr; Object *refb = T::___get_from_variant(p_variant); if (refb == nullptr) { @@ -168,7 +153,6 @@ public: // mutexes will avoid more crashes? if (reference && reference->unreference()) { - //memdelete(reference); reference->free(); } @@ -181,12 +165,10 @@ public: } Ref() { - reference = nullptr; } ~Ref() { - unref(); } -- cgit v1.2.3