-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
Prerequisites
- [c] Put an X between the brackets on this line if you have done all of the following:
- Checked that your issue isn't already filed.
- Specifically, check out the wishlist, open RFCs,
or feature requests.
- Specifically, check out the wishlist, open RFCs,
- Reduced the issue to a self-contained, reproducible test case.
- Checked that your issue isn't already filed.
Description
In file included from /disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/predict.cpp:2:
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/mepo.cpp:30:19: warning: loop variable 's' creates a copy from type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, double>, void *> *>>::value_type' (aka 'const pair<const long, double>') [-Wrange-loop-construct]
for (const auto s : syms1)
^
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/mepo.cpp:30:8: note: use reference type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, double>, void *> *>>::value_type &' (aka 'const pair<const long, double> &') to prevent copying
for (const auto s : syms1)
^~~~~~~~~~~~~~
&
In file included from /disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/predict.cpp:3:
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/nbayes.cpp:66:19: warning: loop variable 'sv' creates a copy from type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, long>, void *> *>>::value_type' (aka 'const pair<const long, long>') [-Wrange-loop-construct]
for (const auto sv : sfreqh) {
^
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/nbayes.cpp:66:8: note: use reference type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, long>, void *> *>>::value_type &' (aka 'const pair<const long, long> &') to prevent copying
for (const auto sv : sfreqh) {
^~~~~~~~~~~~~~~
&
Such warnings usually mean that the code wastes some CPU cycles on unnecessary object copying.
Steps to Reproduce
regular build
Versions
lean-3.48.0
clang-14
FreeBSD 13.1
Metadata
Metadata
Assignees
Labels
No labels