Small fix
This commit is contained in:
parent
2cac5bd829
commit
bc6709e905
@ -22,6 +22,14 @@
|
|||||||
this.isLeft = false;
|
this.isLeft = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bazowa metoda dopasowania wzorów.
|
||||||
|
/// Jeśli podana jest wartość lewa, to Match zwróci wynik lewej funkcji, w przeciwnym razie wynik prawej funkcji.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="leftFunc">Lewa funkcja </param>
|
||||||
|
/// <param name="rightFunc">Prawa funkcja</param>
|
||||||
|
/// <returns>Wynik prawej/lewej funkcji</returns>
|
||||||
public T Match<T>(Func<TL, T> leftFunc, Func<TR, T> rightFunc)
|
public T Match<T>(Func<TL, T> leftFunc, Func<TR, T> rightFunc)
|
||||||
{
|
{
|
||||||
if (leftFunc == null)
|
if (leftFunc == null)
|
||||||
@ -37,10 +45,6 @@
|
|||||||
return this.isLeft ? leftFunc(this.left) : rightFunc(this.right);
|
return this.isLeft ? leftFunc(this.left) : rightFunc(this.right);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If right value is assigned, execute an action on it.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="rightAction">Akcja do wykonania</param>
|
|
||||||
public void DoRight(Action<TR> rightAction)
|
public void DoRight(Action<TR> rightAction)
|
||||||
{
|
{
|
||||||
if (rightAction == null)
|
if (rightAction == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user