WaE: use of logical '&&' with constant operand

Surely it's the bitwise operator & that is wanted here. The code makes
no sense otherwise. We apparently have been generating UUIDs where
every second hex digit is always a '1', like
{x1x1x1x1-x1x1-x1x1-x1x1-x1x1x1x1x1x1} (where each x is a random hex
digit).
This commit is contained in:
Tor Lillqvist 2012-03-03 00:05:55 +02:00
parent b43bdd47fe
commit 30313007a8

View file

@ -906,27 +906,27 @@ void DrawingML::GetUUID( OStringBuffer& rBuffer )
rBuffer.append( '{' );
for( i = 0; i < 4; i++ ) {
rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
}
rBuffer.append( '-' );
for( ; i < 6; i++ ) {
rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
}
rBuffer.append( '-' );
for( ; i < 8; i++ ) {
rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
}
rBuffer.append( '-' );
for( ; i < 10; i++ ) {
rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
}
rBuffer.append( '-' );
for( ; i < 16; i++ ) {
rBuffer.append( cDigits[ aSeq[i] >> 4 ] );
rBuffer.append( cDigits[ aSeq[i] && 0xf ] );
rBuffer.append( cDigits[ aSeq[i] & 0xf ] );
}
rBuffer.append( '}' );
}