Instantiating a variable if null

前端 未结 0 500
傲寒
傲寒 2021-02-12 06:08
if (x == null) x = new X();

versus

x = x ?? new X();

which of these two is actually more performant? once compiled do

相关标签:
回答
  • 消灭零回复
提交回复
热议问题