Skip to content

Commit 745e15b

Browse files
Improve Java gencode static initialization to avoid unnecessary temporaries again
PiperOrigin-RevId: 800056423
1 parent 294d639 commit 745e15b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/google/protobuf/compiler/java/full/extension.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,9 @@ int ImmutableExtensionGenerator::GenerateNonNestedInitializationCode(
132132
int bytecode_estimate = 0;
133133
if (descriptor_->extension_scope() == nullptr) {
134134
// Only applies to non-nested extensions.
135-
printer->Print(
136-
"$name$.internalInit(descriptor.getExtensions().get($index$));\n",
137-
"name", UnderscoresToCamelCaseCheckReserved(descriptor_), "index",
138-
absl::StrCat(descriptor_->index()));
135+
printer->Print("$name$.internalInit(descriptor.getExtension($index$));\n",
136+
"name", UnderscoresToCamelCaseCheckReserved(descriptor_),
137+
"index", absl::StrCat(descriptor_->index()));
139138
bytecode_estimate += 21;
140139
}
141140
return bytecode_estimate;

0 commit comments

Comments
 (0)