Skip to content

Commit f1d5c27

Browse files
authored
moved names declaration to first use (#7283)
1 parent d7833cb commit f1d5c27

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
@@ -542,7 +542,6 @@ SEXP perhapsDataTableR(SEXP x) {
542542
}
543543

544544
SEXP frev(SEXP x, SEXP copyArg) {
545-
SEXP names;
546545
if (INHERITS(x, char_dataframe))
547546
error(_("'x' should not be data.frame or data.table."));
548547
if (!IS_TRUE_OR_FALSE(copyArg))
@@ -629,8 +628,10 @@ SEXP frev(SEXP x, SEXP copyArg) {
629628
default:
630629
error(_("Type '%s' is not supported by frev"), type2char(TYPEOF(x)));
631630
}
632-
names = PROTECT(getAttrib(x, R_NamesSymbol));
631+
632+
SEXP names = PROTECT(getAttrib(x, R_NamesSymbol));
633633
nprotect++;
634+
634635
if (copy) {
635636
SEXP klass = PROTECT(getAttrib(x, R_ClassSymbol));
636637
SEXP levels = PROTECT(getAttrib(x, R_LevelsSymbol));

0 commit comments

Comments
 (0)