Avoid branching code for degenerate cases in Fibonacci generator
Consider breaking it up into two methods: one, Fibonacci(), that represents the infinite* Fibonacci sequence, and another, Fibonacci(int), that just returns Fibonacci().Take(n). This removes the branching.

An implementation might look like this:

static IEnumerable&lt;int&gt; Fibonacci(int n)
{
    return Fibonacci().Take(n);
}

static IEnumerable&lt;int&gt; Fibonacci()
{
    int a = 0;
    int b = 1;
    while (true)
    {
        yield return a;
        int c = a + b;
        a = b;
        b = c;
    }
}


* Well, the first 47 values that fit in an int.