首页 > 其他 > 详细

重构复杂的boolean函数

时间:2015-02-26 01:16:41      阅读:269      评论:0      收藏:0      [点我收藏+]

 here’s what my first (virtual) solution was:

1
2
3
4
5
6
function Refactored(const someInputParameters : integer): boolean;
const
  returnValue : array [0..1] of boolean = (false, true);
begin
  result := returnValue[GetTickCount MOD 2];
end;

From the first look, the above implementation of a boolean function is as good as any. After all, it would return either true or false, there’s no 3rd option with booleans 技术分享

 

技术分享

 

Fun: Refactoring a Complex Delphi Boolean Function

http://zarko-gajic.iz.hr/fun-refactoring-a-complex-delphi-boolean-function/

重构复杂的boolean函数

原文:http://www.cnblogs.com/fanbbs/p/4298571.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!