message: Early return to remove indent
diff: @@ -418,9 +418,11 @@ SEXP duckdb_execute_R(SEXP stmtsexp) {
  SEXP duckdb_execute_R_impl(MaterializedQueryResult *result) {
  // step 2: create result data frame and allocate columns
  uint32_t ncols = result->types.size();
  - uint64_t nrows = result->collection.count;
  + if (ncols == 0) {
  + return ScalarReal(0); // no need for protection because no allocation can happen afterwards
  + }
  - if (ncols > 0) {
  + uint64_t nrows = result->collection.count;
  SEXP retlist = PROTECT(NEW_LIST(ncols));
  SET_NAMES(retlist, cpp_str_to_strsexp(result->names));
  @@ -621,8 +623,6 @@ SEXP duckdb_execute_R_impl(MaterializedQueryResult *result) {
  UNPROTECT(1); /* retlist */
  return retlist;
  }
  - return ScalarReal(0); // no need for protection because no allocation can happen afterwards
  -}
  static SEXP duckdb_finalize_database_R(SEXP dbsexp) {
  if (TYPEOF(dbsexp) != EXTPTRSXP) {
  