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

ruby-changes:72466

From: Nobuyoshi <ko1@a...>
Date: Fri, 8 Jul 2022 17:27:35 +0900 (JST)
Subject: [ruby-changes:72466] 7bab788309 (master): Simplify BLSR code

https://git.ruby-lang.org/ruby.git/commit/?id=7bab788309

From 7bab7883093df12048c4535b59b04e73f3b3b4ad Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 8 Jul 2022 15:59:25 +0900
Subject: Simplify BLSR code

And suppress unary minus operator to unsigned type warnings by VC.
---
 iseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iseq.c b/iseq.c
index 36f625d1bb..20ca93b596 100644
--- a/iseq.c
+++ b/iseq.c
@@ -257,7 +257,7 @@ iseq_scan_bits(unsigned int page, iseq_bits_t bits, VALUE *code, iseq_value_itr_ https://github.com/ruby/ruby/blob/trunk/iseq.c#L257
                 original_iseq[page_offset + offset] = newop;
             }
         }
-        bits ^= bits & -bits; // Reset Lowest Set Bit (BLSR)
+        bits &= bits - 1; // Reset Lowest Set Bit (BLSR)
     }
 }
 
-- 
cgit v1.2.1


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

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