* src/sanity/style.test: Suggest ++i over i++ when it does not

matter, for consistency.
* src/tgbaalgos/tarjan_on_fly.cc, iface/gspn/ssp.cc,
src/tgbaalgos/reductgba_sim_del.cc, src/tgbaalgos/reductgba_sim.cc,
src/tgbaalgos/minimalce.cc, src/tgba/tgbareduc.cc: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2004-09-23 12:20:10 +00:00
parent 3780650ea0
commit 3f2cba6304
9 changed files with 38 additions and 30 deletions

View file

@ -119,12 +119,15 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
# std::list::size() can be O(n). Better use empty() whenever
# possible, even for other containers.
grep -E '(->|[.])size\(\) [=!]= 0|![a-zA-Z0-9_]*(->|[.])size\(\)|(if |while |assert)\([a-zA-Z0-9_]*(->|[.])size\(\)\)' $tmp &&
egrep '(->|[.])size\(\) [=!]= 0|![a-zA-Z0-9_]*(->|[.])size\(\)|(if |while |assert)\([a-zA-Z0-9_]*(->|[.])size\(\)\)' $tmp &&
diag 'Prefer empty() to check emptiness.'
egrep '^[^=]*([+][+]|--);' $tmp &&
diag 'Take good habits: use ++i instead of i++ when you have the choice.'
case $file in
*.hh | *.hxx)
if grep -E '(cout|cerr|clog)' $tmp >/dev/null; then
if egrep '(cout|cerr|clog)' $tmp >/dev/null; then
:
else
grep '#.*include.*<iostream>' $tmp &&