WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 months ago

#16745 closed enhancement (wontfix)

doubled replace in setup_postdata

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: General Keywords: has-patch
Focuses: Cc:

Attachments (4)

16745.patch (603 bytes) - added by hakre 3 years ago.
One off
16745.2.patch (749 bytes) - added by hakre 3 years ago.
Array'ed
16745.3.patch (1.4 KB) - added by hakre 3 years ago.
The "while we're at it" stop-by
16745.4.patch (1.4 KB) - added by hakre 3 years ago.
Same as prev but with #16746 fix

Download all attachments as: .zip

Change History (9)

hakre3 years ago

One off

hakre3 years ago

Array'ed

hakre3 years ago

The "while we're at it" stop-by

comment:1 hakre3 years ago

  • Type changed from defect (bug) to enhancement

hakre3 years ago

Same as prev but with #16746 fix

comment:2 hakre3 years ago

In case of fixing #16746, another patch has been attached as .3 would conflict merge with the fix in #16746.

Last edited 3 years ago by hakre (previous) (diff)

comment:3 follow-up: garyc403 years ago

I'm sorry, but, what?

Could you write a better description for this ticket? And what do your patches have anything to do with the URL you posted?

comment:4 in reply to: ↑ 3 hakre3 years ago

Replying to garyc40:

I'm sorry, but, what?

Could you write a better description for this ticket?

The patches are rather trivial so I thought self explanatory:

If you first replace BA with A and then replace AB with A then there is no need to replace BAB with A as a third replace variant upfront.

Next to that, you can make use of arrays to replace multiple needles at once.

And what do your patches have anything to do with the URL you posted?

The URL was just informative, if you visit that address you will see the sourcecode of function setup_postdata() this ticket is about.

comment:5 dd328 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Although the first case IS covered by the 2nd case running, and then the 3rd case running, the current code is much more explicit in what it's doing.

Since there's no significant performance alterations between using multiple calls, vs, an array notation, lets keep it explicitly ordered.

Note: See TracTickets for help on using tickets.