码迷,mamicode.com
首页 > 其他好文 > 详细

重构复杂的boolean函数

时间:2015-02-26 01:17:18      阅读:109      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!