[前][次][番号順一覧][スレッド一覧]

ruby-changes:68089

From: Nobuyoshi <ko1@a...>
Date: Thu, 23 Sep 2021 16:56:34 +0900 (JST)
Subject: [ruby-changes:68089] 8b48b57fd8 (master): Comparing nonnull argument to NULL is useless

https://git.ruby-lang.org/ruby.git/commit/?id=8b48b57fd8

From 8b48b57fd89ad1bbb1d3b4b8445a65ab2d0b272b Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 23 Sep 2021 16:40:04 +0900
Subject: Comparing nonnull argument to NULL is useless

---
 enumerator.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/enumerator.c b/enumerator.c
index 0dc804a..f359ab7 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -3446,9 +3446,11 @@ rb_arithmetic_sequence_extract(VALUE obj, rb_arithmetic_sequence_components_t *c https://github.com/ruby/ruby/blob/trunk/enumerator.c#L3446
 VALUE
 rb_arithmetic_sequence_beg_len_step(VALUE obj, long *begp, long *lenp, long *stepp, long len, int err)
 {
+#if !RBIMPL_HAS_ATTRIBUTE(nonnull)
     RUBY_ASSERT(begp != NULL);
     RUBY_ASSERT(lenp != NULL);
     RUBY_ASSERT(stepp != NULL);
+#endif
 
     rb_arithmetic_sequence_components_t aseq;
     if (!rb_arithmetic_sequence_extract(obj, &aseq)) {
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]