[vibration] Reordered steps 3 and 5 for better performance

Hi,

I reordered the steps 3 and 5 [1] in the 'processing vibration patterns' algorithm [2] to perform the likely cheaper operation first. Checking the length of the pattern is probably cheaper than checking the length of each entry, thus it makes sense to do the cheaper operation first.

The new order:

[[

3. If the length of pattern exceeds an implementation-dependent limit, then return false and terminate these steps.

[...]

5. If any entry of pattern exceeds an implementation-dependent limit, then return false and terminate these steps.

]]

-Anssi

[1] http://dev.w3.org/cvsweb/2009/dap/vibration/Overview.src.html.diff?r1=1.4;r2=1.5;f=h
[2] http://dev.w3.org/2009/dap/vibration/#dfn-processing-vibration-patterns

Received on Wednesday, 12 June 2013 17:57:35 UTC