Skip to content

Commit 926bb0e

Browse files
better writing style
Co-authored-by: Toby Dylan Hocking <[email protected]>
1 parent c2c5d89 commit 926bb0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/fwrite.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
4343
}
4444
# Handle select argument using .shallow()
4545
if (!is.null(select)) {
46-
if (is.integer(select) || is.numeric(select)) { # numeric/integer avoids O(#cols) name-match overhead
47-
cols = as.integer(select)
46+
cols = if (is.integer(select) || is.numeric(select)) { # numeric/integer avoids O(#cols) name-match overhead
47+
as.integer(select)
4848
} else {
49-
cols = colnamesInt(x, select)
49+
colnamesInt(x, select)
5050
}
5151
if (is.data.table(x)) {
5252
if (length(cols) < NCOL(x) || !identical(cols, seq_len(NCOL(x)))) { # only build a shallow view when columns are reduced or reordered

0 commit comments

Comments
 (0)