Array functions optimization #1154

Open
opened 2026-10-05 00:33:28 +02:00 by adam · 0 comments
Owner

We can improve performance on some things:

  • We are using in_array in some parts, when we are just hardcoding one element. Replace with just === is faster and compatible.
  • We are using in_array($variable, array_keys($array)) when we could use array_key_exists(). This improves performance and is compatible.
We can improve performance on some things: - We are using in_array in some parts, when we are just hardcoding one element. Replace with just === is faster and compatible. - We are using `in_array($variable, array_keys($array))` when we could use array_key_exists(). This improves performance and is compatible. <!-- github-sync-id:802752275 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1154