I need critique on this code
C#
21
Posts
5
Posters
0
Views
1
Watching
-
Yes, but the additional method calls could become a bottleneck in a tight loop. And the resultant code could be even less readable. You need to examine each case on its own.
I'd say it's probably unlikely, as the JIT compiler is able to inline function calls. In any event, if it's a tight loop, it seems pretty weird that there would be a region in the code anyway, in which case a method call would also seem unnecessary to break out the logic. And my point was that if you are thinking of making a region in your method, it's probably because your are trying to compress a bunch of code into a smaller block and that is usually better done with a method call.