[imp][managed-ledger] Optimize filterReadEntries usage of Entry interface ledger
@@ -2288,9 +2288,7 @@ public class ManagedCursorImpl implements ManagedCursor {
} else {
// Remove from the entry list all the entries that were already marked for deletion
return Lists.newArrayList(Collections2.filter(entries, entry -> {
- boolean includeEntry = !individualDeletedMessages.contains(
- ((PositionImpl) entry.getPosition()).getLedgerId(),
- ((PositionImpl) entry.getPosition()).getEntryId());
+ boolean includeEntry = !individualDeletedMessages.contains(entry.getLedgerId(), entry.getEntryId());
if (!includeEntry) {
if (log.isDebugEnabled()) {
log.debug("[{}] [{}] Filtering entry at {} - already deleted", ledger.getName(), name,
