Skip to content

Commit

Permalink
Let's try to use more built-in PHP functins
Browse files Browse the repository at this point in the history
use array_fill() instead of for loop
  • Loading branch information
bbannon authored May 15, 2024
1 parent a583cb4 commit 10f0569
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions purge.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,9 @@ function purge_events ( $ids ) {
['webcal_entry', 'cal_id']];

//var_dump($tables);exit;
$num = [];
$cnt = count ( $tables );
for ( $i = 0; $i < $cnt; $i++ ) {
$num[$i] = 0;
}
$num = array_fill ( 0, $cnt, 0 );

foreach ( $ids as $cal_id ) {
for ( $i = 0; $i < $cnt; $i++ ) {
$clause = ( $cal_id == 'ALL' ? '' :
Expand Down

0 comments on commit 10f0569

Please sign in to comment.