rust-lang/rust-clippy

lint long chains of into/float additions/multiplications

Open

#1,243 创建于 2016年9月25日

在 GitHub 查看
 (13 评论) (0 反应) (0 负责人)Rust (10,406 star) (1,391 fork)batch import
A-lintL-perfT-ASTgood first issue

描述

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.

贡献者指南