ruby-changes:62835
From: Nobuyoshi <ko1@a...>
Date: Sat, 5 Sep 2020 17:34:48 +0900 (JST)
Subject: [ruby-changes:62835] 5c49bb5486 (master): Removed useless casts
https://git.ruby-lang.org/ruby.git/commit/?id=5c49bb5486 From 5c49bb5486587794ab64dca65f535bf0f4c7c249 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 5 Sep 2020 17:28:06 +0900 Subject: Removed useless casts diff --git a/marshal.c b/marshal.c index 2c6ed7a..10114dd 100644 --- a/marshal.c +++ b/marshal.c @@ -1503,13 +1503,12 @@ r_string(struct load_arg *arg) https://github.com/ruby/ruby/blob/trunk/marshal.c#L1503 static VALUE r_entry0(VALUE v, st_index_t num, struct load_arg *arg) { - st_data_t real_obj = (VALUE)Qundef; - if (arg->compat_tbl && st_lookup(arg->compat_tbl, v, &real_obj)) { - st_insert(arg->data, num, (st_data_t)real_obj); - } - else { - st_insert(arg->data, num, (st_data_t)v); + st_data_t real_obj = (st_data_t)v; + if (arg->compat_tbl) { + /* real_obj is kept if not found */ + st_lookup(arg->compat_tbl, v, &real_obj); } + st_insert(arg->data, num, real_obj); return v; } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/