From 7fd010710c0a34ff103bec3fb271f0c207bfcc53 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 26 Aug 2016 13:40:19 -0700 Subject: 3259 Prefer preincrement operators wherever possible. Old versions of compilers used to be better at optimizing them. Even if we don't care about performance it's useful to make unary operators look like unary operators wherever possible, and to distinguish the 'statement form' which doesn't care about the value of the expression from the postincrement which usually increments as a side-effect in some larger computation (and so is worth avoiding except for some common idioms, or perhaps even there). --- 085scenario_console.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '085scenario_console.cc') diff --git a/085scenario_console.cc b/085scenario_console.cc index fc0e21cc..d18792af 100644 --- a/085scenario_console.cc +++ b/085scenario_console.cc @@ -273,7 +273,7 @@ int count_events(const recipe& r) { if (curr.name == "type") result += unicode_length(curr.ingredients.at(0).name); else - result++; + ++result; } return result; } -- cgit 1.4.1-2-gfad0