Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff767c1

Browse files
Avoid 0-length access in more methods
1 parent 6ad9669 commit ff767c1

File tree

3 files changed

+195
-189
lines changed

3 files changed

+195
-189
lines changed

R/bit.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,6 +1925,7 @@ sum.bit <- function(x, range=NULL, ...) {
19251925
if (range[1] < 1L || range[2] > length(x))
19261926
stop("illegal range")
19271927
}
1928+
if (length(x) == 0L) return(0L)
19281929
.Call(C_R_bit_sum, x, range)
19291930
}
19301931

0 commit comments

Comments
 (0)