[Libreoffice] [Patch] Unreachable code ?
Michael Stahl
mstahl at redhat.com
Thu Nov 17 09:08:04 PST 2011
On 17/11/11 17:18, Michael Meeks wrote:
> Hi Muthu,
>
> On Wed, 2011-11-16 at 17:34 +0530, Muthu Subramanian K wrote:
>> I have attached a trivial code removal with this mail.
>> I read the code, (since pUndoSet is set to null in the very constructor,
>> I guess this if() would never get executed), but, I could have missed
>> something here - hence the need for review.
>
> Looks like that was explicitly added in:
>
> commit 493855a92f443535abca8fed0f04ac7c4668a85d
> Author: Pascal Junck <pjunck at openoffice.org>
> Date: Wed Nov 3 10:06:38 2004 +0000
>
> INTEGRATION: CWS aw019 (1.14.140); FILE MERGED
> 2004/09/28 15:53:27 aw 1.14.140.1: #i11190#
>
> Are you certain it is not needed ? then again, an in-line delete rather
> than the if(){} etc. might be good.
no idea if it is needed, but how about replacing pUndoSet with a smart
pointer like boost::scoped_ptr?
then the next line would become 'pUndoSet.reset(new ...)', if pUndoSet
is not null it will be deleted automatically, and you can get rid of the
delete in the destructor as well.
Muthu, please take a look at:
http://www.boost.org/doc/libs/1_46_0/libs/smart_ptr/scoped_ptr.htm
regards,
michael
More information about the LibreOffice
mailing list