about summary refs log tree commit diff stats
path: root/080display.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-26 13:40:19 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-26 13:40:19 -0700
commit7fd010710c0a34ff103bec3fb271f0c207bfcc53 (patch)
tree710cec51fc102241ec540511a72a6ee4c52d3e87 /080display.cc
parent029a3bdf53b523eded91a30177affdcace3bb2a1 (diff)
downloadmu-7fd010710c0a34ff103bec3fb271f0c207bfcc53.tar.gz
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).
Diffstat (limited to '080display.cc')
-rw-r--r--080display.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/080display.cc b/080display.cc
index 9619e5ab..f40b40c8 100644
--- a/080display.cc
+++ b/080display.cc
@@ -223,7 +223,7 @@ case MOVE_CURSOR_DOWN_ON_DISPLAY: {
   int h=tb_height();
   int height = (h >= 0) ? h : 0;
   if (Display_row < height-1) {
-    Display_row++;
+    ++Display_row;
     tb_set_cursor(Display_column, Display_row);
     if (Autodisplay) tb_present();
   }
@@ -241,7 +241,7 @@ case MOVE_CURSOR_UP_ON_DISPLAY: {
 :(before "End Primitive Recipe Implementations")
 case MOVE_CURSOR_UP_ON_DISPLAY: {
   if (Display_row > 0) {
-    Display_row--;
+    --Display_row;
     tb_set_cursor(Display_column, Display_row);
     if (Autodisplay) tb_present();
   }
@@ -261,7 +261,7 @@ case MOVE_CURSOR_RIGHT_ON_DISPLAY: {
   int w=tb_width();
   int width = (w >= 0) ? w : 0;
   if (Display_column < width-1) {
-    Display_column++;
+    ++Display_column;
     tb_set_cursor(Display_column, Display_row);
     if (Autodisplay) tb_present();
   }
@@ -279,7 +279,7 @@ case MOVE_CURSOR_LEFT_ON_DISPLAY: {
 :(before "End Primitive Recipe Implementations")
 case MOVE_CURSOR_LEFT_ON_DISPLAY: {
   if (Display_column > 0) {
-    Display_column--;
+    --Display_column;
     tb_set_cursor(Display_column, Display_row);
     if (Autodisplay) tb_present();
   }
@@ -293,7 +293,7 @@ else if (tb_is_active()) {
 }
 :(code)
 void move_cursor_to_start_of_next_line_on_display() {
-  if (Display_row < tb_height()-1) Display_row++;
+  if (Display_row < tb_height()-1) ++Display_row;
   else Display_row = 0;
   Display_column = 0;
   tb_set_cursor(Display_column, Display_row);