Instantiating a variable if null

前端 未结 0 1188
日久生厌
日久生厌 2021-02-12 06:23
if (x == null) x = new X();

versus

x = x ?? new X();

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

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