[wp-trac] [WordPress Trac] #31182: array_shift in taxonomy.php very slow on large array
WordPress Trac
noreply at wordpress.org
Sat Jan 31 01:10:50 UTC 2015
#31182: array_shift in taxonomy.php very slow on large array
--------------------------+------------------
Reporter: VolodymyrC | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.2
Component: Taxonomy | Version: 2.7
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+------------------
Comment (by boonebgorges):
Replying to [comment:4 toscho]:
> I don’t see why we should change the original array at all. We just have
to move the pointer, right?
>
> {{{
> do {
> $term = current ( $terms );
> // add term to new array depending on condition
> } while ( next( $terms );
> }}}
Right, or `foreach`. `array_pop()` seems unnecessary.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31182#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list