do {…} while(false)

前端 未结 25 2461
小鲜肉
小鲜肉 2020-11-28 03:29

I was looking at some code by an individual and noticed he seems to have a pattern in his functions:

 function()
{
 

        
25条回答
  •  难免孤独
    2020-11-28 03:48

    This is amusing. There are probably breaks inside the loop as others have said. I would have done it this way :

    while(true)
    {
       
    break; // at the end. }

提交回复
热议问题