除了确保它们无法更改(编译器错误的调整)之外,JIT是否对const本地进行任何优化?
例如.
public static int Main(string[] args) { const int timesToLoop = 50; for (int i=0; i<timesToLoop; i++) { // ... } }
c# jit const
c# ×1
const ×1
jit ×1