Skip to content

Commit 6cade31

Browse files
committed
moved names declaration to first use
1 parent 6e63f5b commit 6cade31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ SEXP perhapsDataTableR(SEXP x) {
541541
}
542542

543543
SEXP frev(SEXP x, SEXP copyArg) {
544-
SEXP names;
545544
if (INHERITS(x, char_dataframe))
546545
error(_("'x' should not be data.frame or data.table."));
547546
if (!IS_TRUE_OR_FALSE(copyArg))
@@ -628,8 +627,10 @@ SEXP frev(SEXP x, SEXP copyArg) {
628627
default:
629628
error(_("Type '%s' is not supported by frev"), type2char(TYPEOF(x)));
630629
}
631-
names = PROTECT(getAttrib(x, R_NamesSymbol));
630+
631+
SEXP names = PROTECT(getAttrib(x, R_NamesSymbol));
632632
nprotect++;
633+
633634
if (copy) {
634635
SEXP klass = PROTECT(getAttrib(x, R_ClassSymbol));
635636
SEXP levels = PROTECT(getAttrib(x, R_LevelsSymbol));

0 commit comments

Comments
 (0)