File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -159,10 +159,7 @@ MAKE_PTRARG_BY_REFERENCE(Variant);
159159template <typename T>
160160struct PtrToArg <T *> {
161161 _FORCE_INLINE_ static T *convert (const void *p_ptr) {
162- if (p_ptr == nullptr ) {
163- return nullptr ;
164- }
165- return const_cast <T *>(*reinterpret_cast <T *const *>(p_ptr));
162+ return likely (p_ptr) ? const_cast <T *>(*reinterpret_cast <T *const *>(p_ptr)) : nullptr ;
166163 }
167164 typedef Object *EncodeT;
168165 _FORCE_INLINE_ static void encode (T *p_var, void *p_ptr) {
@@ -173,10 +170,7 @@ struct PtrToArg<T *> {
173170template <typename T>
174171struct PtrToArg <const T *> {
175172 _FORCE_INLINE_ static const T *convert (const void *p_ptr) {
176- if (p_ptr == nullptr ) {
177- return nullptr ;
178- }
179- return *reinterpret_cast <T *const *>(p_ptr);
173+ return likely (p_ptr) ? *reinterpret_cast <T *const *>(p_ptr) : nullptr ;
180174 }
181175 typedef const Object *EncodeT;
182176 _FORCE_INLINE_ static void encode (T *p_var, void *p_ptr) {
You can’t perform that action at this time.
0 commit comments