in_array function performance
-
Hello guys, it is just a suggestion:
On class-swpm-protection-base.php you check if the post is protected using in_array function, on a big portal with thousands posts protected this gonna have a performance issue.
For the future if you think it worst, you could create the array as an associative array, and use isset, to check if the post is protected.
$array = [ '1548' => 1', '116515' => 1', '851312' => 1', '415511' => 1', '651322' => 1', '651321' => 1', ]; return isset($array[$post_id]);
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘in_array function performance’ is closed to new replies.