/* Function for finding a record of a write buffer allocation.  */
static pdb_buffer_record_t* write_buffer_record_find_next(pm_peer_id_t peer_id, int *p_index)
/* Function for finding a record of a write buffer allocation.  */
static pdb_buffer_record_t* write_buffer_record_find_next(pm_peer_id_t peer_id, int *p_index)
{
    for (uint32_t i = *p_index; i < N_WRITE_BUFFER_RECORDS; i++)
    {
        if ((m_pdb.write_buffer_records[i].peer_id == peer_id))
        {
            return &m_pdb.write_buffer_records[i];
        }
    }
    return NULL;
}