Skip to content
  • rswindell's avatar
    Re-write of smb_getmsgidx_by_time() - using a proper binary search · 3002a275
    rswindell authored
    algorithm now. Also, now returns the index offset of the matched index
    (if found), negative error value otherwise.
    
    I was testing something and noticed that the old smb_getmsgidx_by_time()
    implementation could sometimes return the index of a message posted before
    the requested time. That was fixed by re-writing the binary search logic.
    
    Also, I found it useful in my testing to have this function return the
    offset of the matching index (in addition to the index record itself), so
    checks of the return value need to compare >= SMB_SUCCESS, not just ==
    or != SMB_SUCCESS.
    3002a275