Skip to content
  • Alexandre Janniaux's avatar
    ts: arib: use early return · 10a6fc63
    Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
    It simplifies the handling of the different error cases, and ensure
    every case is ending with a return. The 3: case was not ending with a
    return before, leading to potential (harmless currently) fallthrough to
    the default case.
    
    In addition, between one to two indentation level is saved, and the
    further the reader go through the function, the less guarantee there is
    to check before usage. For instance, after the beginning, p_dr is set to
    be valid without needing to check if we use it in the correct condition
    or not. Thus, even the error handling where breaks fall-through is
    simplified to just clean up existing objects.
    10a6fc63