FXMisc / Flowless

Efficient VirtualFlow for JavaFX
BSD 2-Clause "Simplified" License
185 stars 38 forks source link

org.fxmisc.flowless.CellListManager#getCellIfPresent #89

Closed yqxu closed 3 years ago

yqxu commented 3 years ago

org.fxmisc.flowless.CellListManager#getCellIfPresent

changes the implementation as blow is better.

public Optional<C> getCellIfPresent(int itemIndex) {
    if (itemIndex>=cells.size()||itemIndex<0){
        return Optional.empty();
    }
    return cells.getIfMemoized(itemIndex); // getIfMemoized() may throw
}
Jugen commented 3 years ago

Thanks @yqxu, see PR #90