Don't write unnecessary information to ValueParameter proto
Flags can have a default value and the index can be trivially computed almost all the time
This commit is contained in:
@@ -268,7 +268,9 @@ public class FunctionCodegen {
|
||||
|
||||
if (kind == JvmMethodParameterKind.VALUE) {
|
||||
ValueParameterDescriptor parameter = iterator.next();
|
||||
v.getSerializationBindings().put(INDEX_FOR_VALUE_PARAMETER, parameter, i);
|
||||
if (parameter.getIndex() != i) {
|
||||
v.getSerializationBindings().put(INDEX_FOR_VALUE_PARAMETER, parameter, i);
|
||||
}
|
||||
AnnotationCodegen annotationCodegen = AnnotationCodegen.forParameter(i, mv, typeMapper);
|
||||
|
||||
if (functionDescriptor instanceof PropertySetterDescriptor) {
|
||||
|
||||
+4
-1
@@ -284,7 +284,10 @@ public class DescriptorSerializer {
|
||||
private ProtoBuf.Callable.ValueParameter.Builder valueParameter(@NotNull ValueParameterDescriptor descriptor) {
|
||||
ProtoBuf.Callable.ValueParameter.Builder builder = ProtoBuf.Callable.ValueParameter.newBuilder();
|
||||
|
||||
builder.setFlags(Flags.getValueParameterFlags(hasAnnotations(descriptor), descriptor.declaresDefaultValue()));
|
||||
int flags = Flags.getValueParameterFlags(hasAnnotations(descriptor), descriptor.declaresDefaultValue());
|
||||
if (flags != 0) {
|
||||
builder.setFlags(flags);
|
||||
}
|
||||
|
||||
builder.setName(getSimpleNameIndex(descriptor.getName()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user