Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #17817, comment 117


Ignore:
Timestamp:
03/10/2015 04:48:20 AM (10 years ago)
Author:
nacin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17817, comment 117

    initial v1  
    1515 * `$this->callbacks[ $priority ][ $idx ]` should store a numeric array. If appropriate, use constants such as self::FUNCTION and self::ACCEPTED_ARGS for 0 and 1 indexes. This will reduce memory usage. I have wanted to do this in core, but we couldn't for back compat (direct access of the array, of course). Can we do it now? Would this be manipulation in `getIterator()` (or our own iterator)? Lightweight object with ArrayAccess? Would any of these be worth it?
    1616
    17  * Does the ksort() need to occur on `add_filter()`? This appears wasteful. I recognize this is a very key part of the nesting aspects of this change, but it feels heavy. (I wish PHP were more amenable to linked list manipulation, as in other languages we could do this without resorting to a sort. It's possible )
     17 * Does the ksort() need to occur on `add_filter()`? This appears wasteful. I recognize this is a very key part of the nesting aspects of this change, but it feels heavy. (I wish PHP were more amenable to linked list manipulation, as in other languages we could do this without resorting to a sort. It's possible slicing would be faster than sorting, but I have no data to back this up.)
    1818
    1919 * `$callbacks` appears to unnecessarily be used by reference when `$this->callbacks` is iterated over in a `foreach` in a few places.