Browse code

Use && instead of & in if condition

&& 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).

Hervé Pagès authored on 02/11/2021 01:52:48
Showing 2 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: bsseq
2
-Version: 1.31.0
2
+Version: 1.31.1
3 3
 Encoding: UTF-8
4 4
 Title: Analyze, manage and store bisulfite sequencing data
5 5
 Description: A collection of tools for analyzing and visualizing bisulfite
... ...
@@ -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
               }