Are multiple conditional operators in this situation a good idea?

前端 未结 21 2902
名媛妹妹
名媛妹妹 2020-12-15 06:23

I just saw this block of code on the Wikipedia article on conditional operators:

Vehicle new_vehicle = arg == \'B\' ? bus      :
                      arg ==         


        
21条回答
  •  佛祖请我去吃肉
    2020-12-15 07:17

    Purely a stylistic choice. For small data sets like you present here, then as long as your programming team isn't thrown by such a thing, then its fine in my book.

提交回复
热议问题