summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qplatformbackingstore.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-03-22 15:25:32 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2017-07-14 13:36:46 +0000
commit29af390e3f3503d8f57380823a6122ca259ed971 (patch)
tree5c35e4bf532ab23b24bbfe9a7b67a9c289ba26f7 /src/gui/painting/qplatformbackingstore.h
parentfdfa3b1141a08aface04333e594213efe681ef6e (diff)
Clean up some arithmetic code in an example
The square root of a sum of squares is easier to read and should be computed more accurately if done for us by hypot(). Variables set only once should be set as an initializer and declared const, to make clear this is what's happening. Loop variables can be local to loops. Adding a value to, or subtracting one from, a multiple of itself just multiplies it be one plus (or minus) the multiplier; assigning the result to the same variable is clearer as a *= (especially when the factors are now overt numeric constants). An array of 16k floats all updated in locksteck to the same value can be replaced by a single float that holds that value. Simple things should not be needlessly made more complicated - especially in example code, which should be pedagogic. Change-Id: Idab585cd7df1399c250d4b9f1396a085ae8f3864 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/gui/painting/qplatformbackingstore.h')
0 files changed, 0 insertions, 0 deletions