rust-lang/rust-clippy

lint long chains of into/float additions/multiplications

Open

#1 243 ouverte le 25 sept. 2016

Voir sur GitHub
 (13 commentaires) (0 réactions) (0 assignés)Rust (1 391 forks)batch import
A-lintL-perfT-ASTgood first issue

Métriques du dépôt

Stars
 (10 406 stars)
Métriques de merge PR
 (Merge moyen 19j 22h) (113 PRs mergées en 30 j)

Description

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.

Guide contributeur