improve the logic of change another cell state while sliding a cell

HI, "improve the logic of change another cell state while sliding a cell",thank you