aboutsummaryrefslogtreecommitdiffhomepage
path: root/ruby
diff options
context:
space:
mode:
authorGravatar Zachary Anker <zach.anker@gmail.com>2017-09-21 09:26:54 -0700
committerGravatar GitHub <noreply@github.com>2017-09-21 09:26:54 -0700
commit633ef8bde974a236ef1bdec58c246c0a798d2aa9 (patch)
tree4ecbf2b5f9fff52610f939a097e260d150f33ff7 /ruby
parent87714836e328ca3f98c93a451be26bfd35e804b7 (diff)
Update message.c
Diffstat (limited to 'ruby')
-rw-r--r--ruby/ext/google/protobuf_c/message.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ruby/ext/google/protobuf_c/message.c b/ruby/ext/google/protobuf_c/message.c
index 9d5349a3..be29a9e9 100644
--- a/ruby/ext/google/protobuf_c/message.c
+++ b/ruby/ext/google/protobuf_c/message.c
@@ -260,7 +260,6 @@ int Message_initialize_kwarg(VALUE key, VALUE val, VALUE _self) {
Map_merge_into_self(map, val);
} else if (upb_fielddef_label(f) == UPB_LABEL_REPEATED) {
VALUE ary;
- VALUE entry;
if (TYPE(val) != T_ARRAY) {
rb_raise(rb_eArgError,
@@ -268,7 +267,7 @@ int Message_initialize_kwarg(VALUE key, VALUE val, VALUE _self) {
}
ary = layout_get(self->descriptor->layout, Message_data(self), f);
for (int i = 0; i < RARRAY_LEN(val); i++) {
- entry = rb_ary_entry(val, i);
+ VALUE entry = rb_ary_entry(val, i);
if (TYPE(entry) == T_HASH && upb_fielddef_issubmsg(f)) {
entry = create_submsg_from_hash(f, entry);
}