On Nov 16, 2012 10:24 PM, "tamouse mailing lists" <tamouse.li...@gmail.com>
wrote:
>
> On Fri, Nov 16, 2012 at 12:41 PM, Sebastian Krebs <krebs....@gmail.com>
wrote:
> > Beside this it can be rewritten as
> >
> > switch ((int) (($count-1) / 7) {
> >   case 0: // 1-7
> >   case 1: // 8 - 14
> >   default: // above 15
> > }
>
> Nice code refactoring :) Just a tad obscure for someone coming along
> later

Not only obscure, but depending on the rule being processed could be plain
wrong. It works for the values shown so far, but what if another test is
added to the use case in the future that doesn't fit the clever solution?
Without knowing the intent of the code, it could be a headache to maintain.

Just my 2 cents.

Andrew

Reply via email to