rust-lang/rust-clippy

lint long chains of into/float additions/multiplications

Open

#1243 aperta il 25 set 2016

Vedi su GitHub
 (13 commenti) (0 reazioni) (0 assegnatari)Rust (1391 fork)batch import
A-lintL-perfT-ASTgood first issue

Metriche repository

Star
 (10.406 star)
Metriche merge PR
 (Merge medio 19g 22h) (113 PR mergiate in 30 g)

Descrizione

In generall, (a+b+c)+(d+e+f) is faster to compute than a+b+c+d+e+f, because the former reduces data dependencies, allowing the CPU to run additions in parallel. For float arithmetic, the tree-like addition may improve numerical stability. Suggest inserting parenthesis.

Guida contributor