Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/21/2011 10:27:09 PM (13 years ago)
Author:
djpaul
Message:

Tune up 'for' loops. Fixes #2985, props cnorris23 and r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r4710 r4770  
    559559        $thread_ids = explode( ',', $_POST['thread_ids'] );
    560560
    561         for ( $i = 0; $i < count($thread_ids); $i++ ) {
     561        for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
    562562            BP_Messages_Thread::mark_as_unread($thread_ids[$i]);
    563563        }
     
    575575        $thread_ids = explode( ',', $_POST['thread_ids'] );
    576576
    577         for ( $i = 0; $i < count($thread_ids); $i++ ) {
     577        for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) {
    578578            BP_Messages_Thread::mark_as_read($thread_ids[$i]);
    579579        }
     
    591591        $thread_ids = explode( ',', $_POST['thread_ids'] );
    592592
    593         for ( $i = 0; $i < count($thread_ids); $i++ )
     593        for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i )
    594594            BP_Messages_Thread::delete($thread_ids[$i]);
    595595
    596         _e('Messages deleted.', 'buddypress');
     596        _e( 'Messages deleted.', 'buddypress' );
    597597    }
    598598}
Note: See TracChangeset for help on using the changeset viewer.