[Libreoffice] About "Same expression on both sides of '||'" in LockEntrySequence.cxx
Miklos Vajna
vmiklos at frugalware.org
Sun Jan 15 10:28:02 PST 2012
On Sun, Jan 15, 2012 at 09:04:23AM -0800, julien2412 <serval2412 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120115/9864964c/attachment.pgp>
More information about the LibreOffice
mailing list