Geir Magnusson Jr wrote:

  if ( A || B ) {
     engineReset();
     throw new DigestException( A ?
                "offset incorrect  = " + offset
                : "incorrect len value ");
}

Please :)  That much trouble to avoid writing engineReset() twice?

if (A) {
 resetEngine();
 throw new DigestException("offset incorrect " + offset);
}
if (B) {
 resetEngine();
 throw new DigestException("incorrect len value " + lenValue);
}

In my opinion ?: should only be used if there is a very good reason for it, as it lowers readability for future maintainers.

--
 Thorbjørn  (who reads much more code than he writes ;)

Reply via email to