From f535424cf8225d1b2b42f168bb9e57bdba7be3f7 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 10 Sep 2024 15:02:28 -0500 Subject: [PATCH 1/2] Clarify indent --- src/prop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/prop.c b/src/prop.c index 4d113776..342a93c9 100644 --- a/src/prop.c +++ b/src/prop.c @@ -73,10 +73,11 @@ int name_idx(SEXP list, const char* name) { SEXP names = Rf_getAttrib(list, R_NamesSymbol); if (TYPEOF(names) == STRSXP) - for (int i = 0, n = Rf_length(names); i < n; i++) + for (int i = 0, n = Rf_length(names); i < n; i++) { if (strcmp(CHAR(STRING_ELT(names, i)), name) == 0) return i; - return -1; + } + return -1; } static inline From 5f30981efc7e0356279f17cf469b970a98c8b83c Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 10 Sep 2024 15:03:14 -0500 Subject: [PATCH 2/2] Better clarification --- src/prop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/prop.c b/src/prop.c index 342a93c9..7f5ec376 100644 --- a/src/prop.c +++ b/src/prop.c @@ -72,12 +72,13 @@ static inline int name_idx(SEXP list, const char* name) { SEXP names = Rf_getAttrib(list, R_NamesSymbol); - if (TYPEOF(names) == STRSXP) + if (TYPEOF(names) == STRSXP) { for (int i = 0, n = Rf_length(names); i < n; i++) { if (strcmp(CHAR(STRING_ELT(names, i)), name) == 0) return i; } - return -1; + } + return -1; } static inline