Skip to content
Snippets Groups Projects
Commit 45df9023 authored by Per Hedbor's avatar Per Hedbor
Browse files

Changed worst-case ordo of replace(array,item1,item2) from O(n^2) to O(n).

Replace uses search_array, which in turn calls
check_array_for_destruct.  So, if you had an array where all elements
were replaced by the replace containing at least one object replace()
was O(n^2), not O(n).

In general check_array_for_destruct is rather unneeded, since the
comparison functions already checks for destructed objects, but I
guess that it might cause objects to be free:d slightly sooner.
parent b7e55a7b
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment