Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#14838 closed enhancement (wontfix)

get_theme_root/s refactoring

Reported by: hakre's profile hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: General Keywords: has-patch close
Focuses: Cc:

Description

Some little work over the code while I ran over it.

Attachments (1)

14838.patch (1.4 KB) - added by hakre 13 years ago.

Download all attachments as: .zip

Change History (9)

@hakre
13 years ago

#1 @hakre
13 years ago

  • Type changed from defect (bug) to task (blessed)

#2 @hakre
13 years ago

  • Version changed from 3.1 to 3.0

#3 @jane
13 years ago

@hakre: Only the lead devs should change something to task (blessed), as it means it has been blessed by the leads.

#4 @nacin
13 years ago

Both of these changes make the code less readable.

(Not a task, at best an enhancement.)

#5 @nacin
13 years ago

  • Keywords close added
  • Type changed from task (blessed) to enhancement

#6 @filosofo
13 years ago

 	472	        while ( false === ( $theme_roots = get_site_transient( 'theme_roots' ) ) ) 
 	473	                get_themes(); // update transient 

Isn't this kinda risky? If something causes the transient getter or setter to fail, then you're stuck in an infinite loop.

#7 follow-up: @scribu
13 years ago

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

I agree that this makes the code less readable. Cleverer code is not always better code.

#8 in reply to: ↑ 7 @hakre
13 years ago

Replying to filosofo:

 	472	        while ( false === ( $theme_roots = get_site_transient( 'theme_roots' ) ) ) 
 	473	                get_themes(); // update transient 

Isn't this kinda risky? If something causes the transient getter or setter to fail, then you're stuck in an infinite loop.

True, which would result in same: a failt of get_theme_roots() (as w/o the patch).

---

Replying to scribu:

I agree that this makes the code less readable. Cleverer code is not always better code.

Code is never clever.

Less code is better code.

Note: See TracTickets for help on using tickets.