Commit 06a2e298 authored by Jisi Liu's avatar Jisi Liu

Equals for message oneof field in nano.

parent c72d3d51
......@@ -214,6 +214,16 @@ GenerateSerializedSizeCode(io::Printer* printer) const {
void MessageOneofFieldGenerator::
GenerateEqualsCode(io::Printer* printer) const {
printer->Print(variables_,
"if (this.has$capitalized_name$()) {\n"
" if (!this.$oneof_name$_.equals(other.$oneof_name$_)) {\n"
" return false;\n"
" }\n"
"} else {\n"
" if (other.has$capitalized_name$()) {\n"
" return false;\n"
" }\n"
"}\n");
}
void MessageOneofFieldGenerator::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment