more uses of unionDiscrim.set

This commit is contained in:
David Renshaw 2014-05-21 21:06:18 -04:00
parent 9f368ff3ec
commit d3aff83097

View file

@ -554,9 +554,9 @@ private:
kj::strTree(spaces(indent), " public final boolean is", titleCase, "() {\n",
spaces(indent), " return which() == ", scope, "Which.", upperCase,";\n",
spaces(indent), " }\n"),
kj::strTree(spaces(indent), " public final boolean is", titleCase, "() {\n",
spaces(indent), " return which() == ", scope, "Which.", upperCase, ";\n",
spaces(indent), " }\n"),
kj::strTree(spaces(indent), "public final boolean is", titleCase, "() {\n",
spaces(indent), " return which() == ", scope, "Which.", upperCase, ";\n",
spaces(indent), "}\n"),
kj::strTree(
"inline boolean ", scope, "Reader::is", titleCase, "() const {\n"
" return which() == ", scope, upperCase, ";\n"
@ -796,10 +796,13 @@ private:
spaces(indent), " }\n",
(typeBody.which() == schema::Type::VOID ?
kj::strTree(spaces(indent), " public final void set", titleCase, "() {}\n") :
kj::strTree(spaces(indent), " public final void set", titleCase, "() {\n",
unionDiscrim.set,
spaces(indent), " }\n") :
(typeBody.which() == schema::Type::ENUM ?
kj::strTree(
spaces(indent), " public final void set", titleCase, "(", type, " value) {\n",
unionDiscrim.set,
spaces(indent), " _builder.setShortField(", offset, ", (short)value.ordinal());\n",
spaces(indent), " }\n") :
kj::strTree(