Drop useless parameter and avoid creating sets
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2016 JetBrains s.r.o.
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -22,7 +22,6 @@ import org.jetbrains.kotlin.cfg.Label
|
|||||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.Instruction
|
import org.jetbrains.kotlin.cfg.pseudocode.instructions.Instruction
|
||||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.*
|
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.*
|
||||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicKind.*
|
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicKind.*
|
||||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.AbstractJumpInstruction
|
|
||||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.ConditionalJumpInstruction
|
import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.ConditionalJumpInstruction
|
||||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.ReturnValueInstruction
|
import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.ReturnValueInstruction
|
||||||
import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.ThrowExceptionInstruction
|
import org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.ThrowExceptionInstruction
|
||||||
@@ -116,10 +115,7 @@ fun getExpectedTypePredicate(
|
|||||||
TracingStrategy.EMPTY,
|
TracingStrategy.EMPTY,
|
||||||
DataFlowInfoForArgumentsImpl(DataFlowInfo.EMPTY, call)
|
DataFlowInfoForArgumentsImpl(DataFlowInfo.EMPTY, call)
|
||||||
)
|
)
|
||||||
val status = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(call,
|
val status = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(call, TracingStrategy.EMPTY, candidateCall)
|
||||||
TracingStrategy.EMPTY,
|
|
||||||
candidateCall,
|
|
||||||
LinkedHashSet())
|
|
||||||
if (!status.isSuccess) continue
|
if (!status.isSuccess) continue
|
||||||
|
|
||||||
val candidateArgumentMap = candidateCall.valueArguments
|
val candidateArgumentMap = candidateCall.valueArguments
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.kotlin.resolve.calls
|
package org.jetbrains.kotlin.resolve.calls
|
||||||
|
|
||||||
import com.google.common.collect.Lists
|
import com.google.common.collect.Lists
|
||||||
import com.google.common.collect.Sets
|
|
||||||
import org.jetbrains.kotlin.builtins.ReflectionTypes
|
import org.jetbrains.kotlin.builtins.ReflectionTypes
|
||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
||||||
@@ -151,7 +150,7 @@ class CandidateResolver(
|
|||||||
private fun <D : CallableDescriptor> CallCandidateResolutionContext<D>.mapArguments()
|
private fun <D : CallableDescriptor> CallCandidateResolutionContext<D>.mapArguments()
|
||||||
= check {
|
= check {
|
||||||
val argumentMappingStatus = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(
|
val argumentMappingStatus = ValueArgumentsToParametersMapper.mapValueArgumentsToParameters(
|
||||||
call, tracing, candidateCall, Sets.newLinkedHashSet<ValueArgument>())
|
call, tracing, candidateCall)
|
||||||
if (!argumentMappingStatus.isSuccess) {
|
if (!argumentMappingStatus.isSuccess) {
|
||||||
candidateCall.addStatus(ARGUMENTS_MAPPING_ERROR)
|
candidateCall.addStatus(ARGUMENTS_MAPPING_ERROR)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2015 JetBrains s.r.o.
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -70,13 +70,11 @@ public class ValueArgumentsToParametersMapper {
|
|||||||
public static <D extends CallableDescriptor> Status mapValueArgumentsToParameters(
|
public static <D extends CallableDescriptor> Status mapValueArgumentsToParameters(
|
||||||
@NotNull Call call,
|
@NotNull Call call,
|
||||||
@NotNull TracingStrategy tracing,
|
@NotNull TracingStrategy tracing,
|
||||||
@NotNull MutableResolvedCall<D> candidateCall,
|
@NotNull MutableResolvedCall<D> candidateCall
|
||||||
@NotNull Set<ValueArgument> unmappedArguments
|
|
||||||
) {
|
) {
|
||||||
//return new ValueArgumentsToParametersMapper().process(call, tracing, candidateCall, unmappedArguments);
|
//return new ValueArgumentsToParametersMapper().process(call, tracing, candidateCall, unmappedArguments);
|
||||||
Processor<D> processor = new Processor<D>(call, candidateCall, tracing);
|
Processor<D> processor = new Processor<D>(call, candidateCall, tracing);
|
||||||
processor.process();
|
processor.process();
|
||||||
unmappedArguments.addAll(processor.unmappedArguments);
|
|
||||||
return processor.status;
|
return processor.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user