Avoid allocation of one PositionImpl object in write path
@@ -166,7 +166,7 @@ class OpAddEntry extends SafeRunnable implements AddCallback, CloseCallback {
updateLatency();
AddEntryCallback cb = callbackUpdater.getAndSet(this, null);
if (cb != null) {
- cb.addComplete(PositionImpl.get(ledger.getId(), entryId), ctx);
+ cb.addComplete(lastEntry, ctx);
ml.notifyCursors();
this.recycle();
}
