Simplified code.

This commit is contained in:
Evgeny Gerashchenko
2013-09-10 18:37:53 +04:00
parent cdbbacaf1c
commit 48e96aece3
@@ -40,11 +40,10 @@ public class CallableDescriptorCollectors {
@NotNull @NotNull
@Override @Override
public Collection<FunctionDescriptor> getNonExtensionsByName(JetScope scope, Name name) { public Collection<FunctionDescriptor> getNonExtensionsByName(JetScope scope, Name name) {
Set<FunctionDescriptor> functions = Sets.newLinkedHashSet(scope.getFunctions(name)); Set<FunctionDescriptor> functions = Sets.newLinkedHashSet();
for (Iterator<FunctionDescriptor> iterator = functions.iterator(); iterator.hasNext(); ) { for (FunctionDescriptor function : scope.getFunctions(name)) {
FunctionDescriptor functionDescriptor = iterator.next(); if (function.getReceiverParameter() == null) {
if (functionDescriptor.getReceiverParameter() != null) { functions.add(function);
iterator.remove();
} }
} }
addConstructors(scope, name, functions); addConstructors(scope, name, functions);