ruby-changes:70252
From: Nobuyoshi <ko1@a...>
Date: Thu, 16 Dec 2021 14:19:59 +0900 (JST)
Subject: [ruby-changes:70252] 05c9dfe23a (master): Suppress empty-body warning
https://git.ruby-lang.org/ruby.git/commit/?id=05c9dfe23a From 05c9dfe23a7d1b970f5b62feeba3199413567fa5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 16 Dec 2021 13:53:15 +0900 Subject: Suppress empty-body warning --- hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hash.c b/hash.c index b0ee2553566..deb5e77872f 100644 --- a/hash.c +++ b/hash.c @@ -6028,12 +6028,12 @@ env_none(VALUE _) https://github.com/ruby/ruby/blob/trunk/hash.c#L6028 static int env_size_with_lock(void) { - int i; + int i = 0; ENV_LOCK(); { char **env = GET_ENVIRON(environ); - for (i=0; env[i]; i++); + while (env[i]) i++; FREE_ENVIRON(environ); } ENV_UNLOCK(); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/