Skip to content

Commit

Permalink
Convert lambdas to method groups
Browse files Browse the repository at this point in the history
References #23
  • Loading branch information
andreashuber-lawo committed May 4, 2016
1 parent 3a6c5b8 commit 3e61c6a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Lawo.EmberPlusSharp/Model/DynamicResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Lawo.EmberPlusSharp.Model
internal sealed class DynamicResult : ResultBase<DynamicResult>
{
internal DynamicResult(IReadOnlyList<KeyValuePair<string, ParameterType>> expectedTypes)
: base(expectedTypes.Select(t => CreateReader(t)).ToArray())
: base(expectedTypes.Select(CreateReader).ToArray())
{
}

Expand Down
3 changes: 1 addition & 2 deletions Lawo.EmberPlusSharp/Model/FunctionBase`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ private async Task<IResult> InvokeCoreAsync(object[] actualArguments)
}

return await this.InvokeCoreAsync(
new DynamicResult(this.result),
this.arguments.Zip(actualArguments, (e, a) => CreateWriter(e, a)).ToArray());
new DynamicResult(this.result), this.arguments.Zip(actualArguments, CreateWriter).ToArray());
}

private void WriteInvocations(EmberWriter writer, IInvocationCollection pendingInvocations)
Expand Down
2 changes: 1 addition & 1 deletion Lawo.EmberPlusSharpTest/Model/ConsumerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ private static Task TestWithRobot<TRoot>(
where TRoot : Root<TRoot>
{
return TestWithRobot<ModelPayloads>(
client => MonitorConnection(Consumer<TRoot>.CreateAsync(client, 4000), c => testCallback(c)),
client => MonitorConnection(Consumer<TRoot>.CreateAsync(client, 4000), testCallback),
CreateLogger(log, logXmlName, "consumer.xml"),
CreateLogger(log, logXmlName, "provider.xml"),
GlowTypes.Instance,
Expand Down
6 changes: 3 additions & 3 deletions Lawo.GlowAnalyzerProxy.Main/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ internal MainWindowViewModel(Settings settings)
a => a.GetValueOrDefault());
#endregion

this.AddValidationRule(this.GetProperty(o => o.ProviderPort), p => ValidatePort(p));
this.AddValidationRule(this.GetProperty(o => o.ListeningPort), p => ValidatePort(p));
this.AddValidationRule(this.GetProperty(o => o.LogFolder), f => ValidateFolder(f));
this.AddValidationRule(this.GetProperty(o => o.ProviderPort), ValidatePort);
this.AddValidationRule(this.GetProperty(o => o.ListeningPort), ValidatePort);
this.AddValidationRule(this.GetProperty(o => o.LogFolder), ValidateFolder);
}

internal bool IsStarted
Expand Down
3 changes: 1 addition & 2 deletions LawoTest/ComponentModel/FlattenHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ private void VerifyModification(Action<ObservableCollection<ReadOnlyObservableCo
for (var round = 0; round < 10; ++round)
{
var children = Enumerable.Range(0, this.Random.Next(10)).Select(i => this.CreateRandomChild()).ToList();
var parent = new ObservableCollection<ReadOnlyObservableCollection<int>>(
children.Select(c => MakeReadOnly(c)));
var parent = new ObservableCollection<ReadOnlyObservableCollection<int>>(children.Select(MakeReadOnly));

using (var flattened =
new ReadOnlyObservableCollection<ReadOnlyObservableCollection<int>>(parent).Flatten())
Expand Down
2 changes: 1 addition & 1 deletion LawoTest/Threading/Tasks/AsyncPumpTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed class AsyncPumpTest : TestBase
public void MainTest()
{
LogMethodPosition("Begin");
AsyncPump.Run(() => DoEverything());
AsyncPump.Run(DoEverything);
LogMethodPosition("End");
}

Expand Down

0 comments on commit 3e61c6a

Please sign in to comment.