Skip to:
Content

BuddyPress.org

Changeset 11516


Ignore:
Timestamp:
03/21/2017 01:35:23 AM (7 years ago)
Author:
boonebgorges
Message:

Remove unnecessary USE INDEX clause building in BP_Activity_Activity.

The resulting clause was unused since [8071].

Props vishalkakadiya.
Fixes #7460.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/classes/class-bp-activity-activity.php

    r11447 r11516  
    545545        $join_sql = apply_filters( 'bp_activity_get_join_sql', $join_sql, $r, $select_sql, $from_sql, $where_sql );
    546546
    547         /**
    548          * Filters the preferred order of indexes for activity item.
    549          *
    550          * @since 1.6.0
    551          *
    552          * @param array $value Array of indexes in preferred order.
    553          */
    554         $indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) );
    555 
    556         foreach( $indexes as $key => $index ) {
    557             if ( false !== strpos( $where_sql, $index ) ) {
    558                 $the_index = $index;
    559                 break; // Take the first one we find.
    560             }
    561         }
    562 
    563         if ( !empty( $the_index ) ) {
    564             $index_hint_sql = "USE INDEX ({$the_index})";
    565         } else {
    566             $index_hint_sql = '';
    567         }
    568 
    569547        // Sanitize page and per_page parameters.
    570548        $page     = absint( $r['page']     );
Note: See TracChangeset for help on using the changeset viewer.