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:
Alexander Udalov
2015-09-24 12:37:45 +03:00
parent ccf72668e0
commit 542bfab96f
9 changed files with 35 additions and 22 deletions
@@ -137,14 +137,14 @@ public abstract class AbstractBinaryClassAnnotationAndConstantLoader<A : Any, C
callable: ProtoBuf.Callable,
nameResolver: NameResolver,
kind: AnnotatedCallableKind,
parameterIndex: Int,
proto: ProtoBuf.Callable.ValueParameter
): List<A> {
val methodSignature = getCallableSignature(callable, nameResolver, kind)
if (methodSignature != null) {
if (proto.hasExtension(index)) {
val paramSignature = MemberSignature.fromMethodSignatureAndParameterIndex(methodSignature, proto.getExtension(index))
return findClassAndLoadMemberAnnotations(container, callable, nameResolver, kind, paramSignature)
}
val index = if (proto.hasExtension(index)) proto.getExtension(index) else parameterIndex
val paramSignature = MemberSignature.fromMethodSignatureAndParameterIndex(methodSignature, index)
return findClassAndLoadMemberAnnotations(container, callable, nameResolver, kind, paramSignature)
}
return listOf()