O(n^2) replaced with O(n) for the line in the title along with O(2n) to O(n) by skipping the array_keys above it.

Comments

sammys’s picture

Issue summary: View changes
StatusFileSize
new1.13 KB
sammys’s picture

StatusFileSize
new1.01 KB

Removed extra parts of patch file paths.

amitaibu’s picture

Status: Active » Needs review

Is the benchmark really significant?

sammys’s picture

Using a benchmark misses the whole point of this patch. The point is that current code wastes CPU cycles and it doesn't need to. It's not worth spending time benchmarking. It's simply changing the code from "working" to "perfect".

amitaibu’s picture

Status: Needs review » Fixed

I've changed array_key_exists() in favor of empty() and committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.