From 5ebcdb71bc635e8eebfa61888f22e746d2b19751 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 14 Jun 2009 00:53:57 +1000 Subject: [PATCH] Prefer Math.max when normalising counts in commands. --- muttator/content/mail.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/muttator/content/mail.js b/muttator/content/mail.js index da4823f7..b02507db 100644 --- a/muttator/content/mail.js +++ b/muttator/content/mail.js @@ -147,7 +147,7 @@ function Mail() //{{{ // does not wrap yet, intentional? function selectUnreadFolder(backwards, count) { - count = (count > 0 ) ? count : 1; + count = Math.max(1, count); let direction = backwards ? -1 : 1; let c = getCurrentFolderIndex(); let i = direction; @@ -462,7 +462,7 @@ function Mail() //{{{ "Select next folder", function (count) { - count = (count > 0 ) ? count : 1; + count = Math.max(1, count); let newPos = getCurrentFolderIndex() + count; if (newPos >= gFolderTreeView.rowCount) { @@ -485,7 +485,7 @@ function Mail() //{{{ "Select previous folder", function (count) { - count = (count > 0 ) ? count : 1; + count = Math.max(1, count); let newPos = getCurrentFolderIndex() - count; if (newPos < 0) {