&& is always preferred over & in if conditions as it prevents the
right operand of the && operation from being unnecessarily evaluated.
In this particular case this change preventively repairs the
updateObject() method for BSseq objects that will otherwise break
on objects with DataFrame instances in them when DataFrame becomes
a virtual class in the S4Vectors package (will happen soon).
... | ... |
@@ -371,7 +371,7 @@ setReplaceMethod( |
371 | 371 |
setMethod("updateObject", "BSseq", |
372 | 372 |
function(object, ...) { |
373 | 373 |
# NOTE: identical() is too strong |
374 |
- if (hasBeenSmoothed(object) & |
|
374 |
+ if (hasBeenSmoothed(object) && |
|
375 | 375 |
isTRUE(all.equal(getBSseq(object, "trans"), .oldTrans))) { |
376 | 376 |
object@trans <- plogis |
377 | 377 |
} |