使用switch语句的最佳做法是使用if30个unsigned枚举的语句,其中约10个具有预期的操作(目前是相同的操作)。性能和空间需要考虑,但并不重要。我已经抽象出了这个片段,所以不要因为命名约定而讨厌我。
switch
if
unsigned
switch 声明:
if 声明:
相似问题