Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#19941 closed enhancement (fixed)

Post template: return string instead of setting then return

Reported by: niallkennedy Owned by: nacin
Priority: normal Milestone: 3.4
Component: Performance Version:
Severity: normal Keywords: has-patch
Cc:

Description

In post template if a password is required to access the post a variable is currently set and the variable returned in the next line.

Return the result of get_the_password_form() instead of writing to a variable and immediately returning that variable.

Attachments (1)

post-template.diff (643 bytes) - added by niallkennedy 16 months ago.
return result of password form

Download all attachments as: .zip

Change History (5)

return result of password form

I wouldn't really call it "performance" but it is indeed good practice to not create a variable you only use once.

  • Summary changed from Post template perf: return string instead of setting then return to Post template: return string instead of setting then return
  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [19812]:

Don't create a variable we only use once. props niallkennedy, fixes #19941.

  • Milestone changed from Awaiting Review to 3.4
Note: See TracTickets for help on using tickets.