Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Sun, Jan 15, 2012 at 09:04:23AM -0800, julien2412 <serval2412@yahoo.fr> wrote:
Cppcheck detects this :
core/ucb/source/ucp/webdav/LockEntrySequence.cxx
174   duplicateExpression     style   Same expression on both sides of '||'.

        case STATE_LOCKENTRY:
            if ( !pCtx->hasType || !pCtx->hasType ) <-- Here
                return 1; // abort
            break;

First, I thought about just replacing the above line by this one : 
if ( !pCtx->hasType || !pCtx->hasScope )

But I wonder if it should be "||" or "&&"

Hi Julien,

Given that it's the same expression (and it's not a method that could
have side-effects), it doesn't matter if it's || or &&, so I would go
ahead with your first thought.

Miklos

Attachment: pgpbOBBjel0oy.pgp
Description: PGP signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.