소스 검색

Updated based on code-review comments.

Chris Fallin 10 년 전
부모
커밋
a3953da536
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      ruby/ext/google/protobuf_c/message.c

+ 1 - 2
ruby/ext/google/protobuf_c/message.c

@@ -88,8 +88,7 @@ static VALUE which_oneof_field(MessageHeader* self, const upb_oneofdef* o) {
       fields[upb_fielddef_index(first_field)].case_offset;
   uint32_t oneof_case = *((uint32_t*)(Message_data(self) + case_ofs));
 
-  // oneof_case == 0 indicates no field set.
-  if (oneof_case == 0) {
+  if (oneof_case == ONEOF_CASE_NONE) {
     return Qnil;
   }