"Example of Simple Delegate Use Creating Garbage"

private static void DoTest() {
    for (int i = 0; i < 10000; ++i) {
        if (PerformIntegerOperation(i, Double) < 0) Console.WriteLine("xyz");
    }
}
 
private static int PerformIntegerOperation(int input, Func<int, int> operation) { return operation(input); }
 
private static int Double(int x) { return x * 2; }


Code snippet taken from "Three Garbage Examples".