Skip to content
  • Felix Lange's avatar
    53a18d2e
    event: document select case slice use and add edge case test (#16680) · 53a18d2e
    Felix Lange authored and Péter Szilágyi's avatar Péter Szilágyi committed
    Feed keeps active subscription channels in a slice called 'f.sendCases'.
    The Send method tracks the active cases in a local variable 'cases'
    whose value is f.sendCases initially. 'cases' shrinks to a shorter
    prefix of f.sendCases every time a send succeeds, moving the successful
    case out of range of the active case list.
    
    This can be confusing because the two slices share a backing array. Add
    more comments to document what is going on. Also add a test for removing
    a case that is in 'f.sentCases' but not 'cases'.
    53a18d2e
    event: document select case slice use and add edge case test (#16680)
    Felix Lange authored and Péter Szilágyi's avatar Péter Szilágyi committed
    Feed keeps active subscription channels in a slice called 'f.sendCases'.
    The Send method tracks the active cases in a local variable 'cases'
    whose value is f.sendCases initially. 'cases' shrinks to a shorter
    prefix of f.sendCases every time a send succeeds, moving the successful
    case out of range of the active case list.
    
    This can be confusing because the two slices share a backing array. Add
    more comments to document what is going on. Also add a test for removing
    a case that is in 'f.sentCases' but not 'cases'.
Loading