Prediction: explain insertions complexity

This commit is contained in:
mischa 2024-03-18 15:49:02 +08:00 committed by MrGadget
parent 1eecc055c5
commit 39338b413d

View File

@ -115,6 +115,7 @@ public static T CorrectHistory<T>(
history.RemoveAt(0); history.RemoveAt(0);
// insert the corrected state into the history, or overwrite if already exists // insert the corrected state into the history, or overwrite if already exists
// SortedList insertions are O(N)!
history[corrected.timestamp] = corrected; history[corrected.timestamp] = corrected;
// the entry behind the inserted one still has the delta from (before, after). // the entry behind the inserted one still has the delta from (before, after).