ROX-33758: Fix quadratic runtime in endpointsStore.addToHistory
#19571
+107
−4
endpointsStore.addToHistory
#19571