Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

불필요한 익명 함수 제거 #1368

Merged
1 commit merged into from Jul 6, 2015
Merged

불필요한 익명 함수 제거 #1368

1 commit merged into from Jul 6, 2015

Conversation

kijin
Copy link
Contributor

@kijin kijin commented Apr 3, 2015

혹시 벌써 PHP 5.3 클로져를 사용하는 코드가 있나 살펴보다가 (실망스럽게도 없더군요) 불필요한 create_function() 몇 개를 발견했습니다.

  • new $class_name() 문법은 PHP 4에서는 지원되지 않았지만 PHP 5에서는 아무 문제가 없으므로 굳이 성능이 떨어지는 익명 함수를 사용하여 우회할 필요가 없습니다.
  • zdate() 함수에서 한자리수 날짜 앞에 0을 붙여 두자리수로 바꾸는 데 사용하는 익명 함수는 훨씬 간단하고 성능도 좋은 sprintf()로 변경하였습니다.
  • Validator 클래스에서 사용하는 익명 함수는 딱히 클로져로 바꾸기도 뭣해서 그냥 두었습니다.

@ghost ghost modified the milestone: next-2015-19 Apr 17, 2015
@ghost ghost modified the milestones: next-2015-19, next-2015-24 May 4, 2015
@misol
Copy link
Contributor

misol commented May 28, 2015

우와.. 이 PR도 매력있어요!

@ghost ghost modified the milestones: next-2015-24, next-2015-28 Jun 9, 2015
@ghost ghost added the type/enhancement label Jul 6, 2015
@ghost ghost merged commit 3ac6579 into xpressengine:develop Jul 6, 2015
ghost pushed a commit that referenced this pull request Jul 6, 2015
Conflicts:
	classes/module/ModuleHandler.class.php
@ghost ghost added the merged-pull-request label Jul 6, 2015
@ghost ghost self-assigned this Jul 6, 2015
@kijin kijin deleted the fix/no-create-function branch July 6, 2015 06:59
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants