Patch: Remove redundant checks
From: Dmitry <wipedout_at_yandex.ru>
Date: Tue, 22 Dec 2009 17:55:33 +0300
Hey.
Looking through TSVN code I've noticed the following suboptimal pattern: checking for null pointer before "delete". That check is redundant - "delete" is guaranteed to do nothing on a null pointer. The checking code only inflates the codebase.
Also in TortoiseProc/RevisionGraph/SearchPathTree.cpp I found some strange code pattern that I marked with a comment. I suggest it is reviewed - looks like a severe bug.
Also there's a couple of snippets where BSTR is blindly assigned to CString. This is bad idea - BSTR can be a null pointer and CString implementaton will exhibit undefined behaviour.
The attached patch removes redundant checks for null pointers, marks the suspicious snippet, rewrites the BSTR->CString conversions and also adds some minor changes.
Best wishes.
------------------------------------------------------
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
|
This is an archived mail posted to the TortoiseSVN Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.