[haiku-bugs] Re: [Haiku] #12825: [Patch] net_buffer.cpp: Fix clang warning

  • From: "TwoFx" <trac@xxxxxxxxxxxx>
  • Date: Mon, 11 Jul 2016 16:14:02 -0000

#12825: [Patch] net_buffer.cpp: Fix clang warning
----------------------------------------+----------------------------
   Reporter:  mt                        |      Owner:  axeld
       Type:  bug                       |     Status:  new
   Priority:  normal                    |  Milestone:  Unscheduled
  Component:  Network & Internet/Stack  |    Version:  R1/Development
 Resolution:                            |   Keywords:
 Blocked By:                            |   Blocking:
Has a Patch:  1                         |   Platform:  All
----------------------------------------+----------------------------

Comment (by TwoFx):

 From my understanding of the code, the only way the loop ought to be
 exited is through the `break` statement in line 1827 and the `return`
 statement in line 1829. Therefore, putting `while (true)` should be
 appropriate. On the other hand, one might argue that `while (left >= 0)`,
 despite doing nothing in practice, more clearly demonstrates the purpose
 of the loop (i.e. removing all bytes that are left).

--
Ticket URL: <https://dev.haiku-os.org/ticket/12825#comment:3>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: