Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#14838 closed enhancement (wontfix)

get_theme_root/s refactoring

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

Description

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

Attachments (1)

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

Download all attachments as: .zip

Change History (9)

@hakre
16 years ago

#1 @hakre
16 years ago

  • Type defect (bug) → task (blessed)

#2 @hakre
16 years ago

  • Version 3.1 → 3.0

#3 @jane
16 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
16 years ago

Both of these changes make the code less readable.

(Not a task, at best an enhancement.)

#5 @nacin
16 years ago

  • Keywords close added
  • Type task (blessed) → enhancement

#6 @filosofo
16 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
16 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

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

#8 in reply to: ↑ 7 @hakre
16 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.