On Wed, Apr 20, 2011 at 04:28:20PM +1000, Peter Hutterer wrote:
>       } else if (initial_velocity != 0) {
>           velocity_diff = fabs(initial_velocity - tracker_velocity);
>           if (velocity_diff <= vel->max_diff ||
>               velocity_diff/(initial_velocity + tracker_velocity) < 
> vel->max_rel_diff) {
>               /* we're in range with the initial velocity,
>                * so this result is likely better
>                * (it contains more information). */
>               result = tracker_velocity;
>               used_offset = offset;
>           }else{
>               /* we're not in range, quit - it won't get better. */
>               DebugAccelF("(dix prtacc) query: tracker too different:"
>                           " old %2.2f initial %2.2f diff: %2.2f\n",
>                           tracker_velocity, initial_velocity, velocity_diff);
>               break;
>           }
>       }

As a minor nit, I think this code would be even more clear this way:

        if (velocity_diff > vel->max_diff && ...) {
                DebugAccelF(...);
                break;
        }
        /* we're in range ... */
        result = tracker_velocity;
        used_offset = offset;

Another minor nit: Restructuring control flow, as you've done with the
introduced continue statement, isn't described by a commit message of
"rename a bunch of variables". :-)

Jamey

Attachment: signature.asc
Description: Digital signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to