diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-03 07:42:18 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-03 07:42:18 +0000 |
commit | 3df2211617c0a9cf78968aeb3f74723b87561a2c (patch) | |
tree | 537ee445fea5a483b85964ef9c5300f6a2b479b9 /protocols/SkypeWeb/src | |
parent | 9f845513c64040ffb2ad7c77949b207a6a980ee1 (diff) |
SkypeWeb: small optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@14828 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r-- | protocols/SkypeWeb/src/skype_db.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/SkypeWeb/src/skype_db.h b/protocols/SkypeWeb/src/skype_db.h index f9b3f7b021..d410919fbd 100644 --- a/protocols/SkypeWeb/src/skype_db.h +++ b/protocols/SkypeWeb/src/skype_db.h @@ -41,11 +41,11 @@ public: __inline explicit pass_ptrA() : data(NULL) {}
__inline explicit pass_ptrA(char* _p) : data(_p) {}
__inline ~pass_ptrA() { zero(); mir_free(data); }
- __inline char* operator = (char * _p) { if (data){ zero(); mir_free(data); } data = _p; return data; }
+ __inline char* operator = (char * _p) { zero(); mir_free(data); data = _p; return data; }
__inline char* operator->() const { return data; }
- __inline operator char *() const { return data; }
+ __inline char* detach() { char *res = data; data = NULL; return res; }
+ __inline operator char*() const { return data; }
__inline operator INT_PTR() const { return (INT_PTR)data; }
- __inline char * detach() { char *res = data; data = NULL; return res; }
__inline void zero() { if (data) SecureZeroMemory(data, mir_strlen(data)); }
};
@@ -57,11 +57,11 @@ public: __inline explicit pass_ptrW() : data(NULL) {}
__inline explicit pass_ptrW(WCHAR* _p) : data(_p) {}
__inline ~pass_ptrW() { zero(); mir_free(data); }
- __inline WCHAR* operator = (WCHAR * _p) { if (data){ zero(); mir_free(data); } data = _p; return data; }
+ __inline WCHAR* operator = (WCHAR * _p) { zero(); mir_free(data); data = _p; return data; }
__inline WCHAR* operator->() const { return data; }
- __inline operator WCHAR *() const { return data; }
+ __inline WCHAR* detach() { WCHAR *res = data; data = NULL; return res; }
+ __inline operator WCHAR*() const { return data; }
__inline operator INT_PTR() const { return (INT_PTR)data; }
- __inline WCHAR * detach() { WCHAR *res = data; data = NULL; return res; }
__inline void zero() { if (data) SecureZeroMemory(data, (mir_wstrlen(data)*sizeof(WCHAR))); }
};
|