ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] incubator-ponymail git commit: redundant matching of same string
Date Sat, 17 Dec 2016 09:21:54 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master eb81ad56e -> aaab3d7ef


redundant matching of same string

This fixes #117

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/4c397152
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/4c397152
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/4c397152

Branch: refs/heads/master
Commit: 4c39715245618c09513239daba0e447e9479b8f3
Parents: eb81ad5
Author: Sebb <sebb@apache.org>
Authored: Sat Dec 17 01:52:11 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Sat Dec 17 01:52:11 2016 +0000

----------------------------------------------------------------------
 CHANGELOG.md       | 3 ++-
 site/api/stats.lua | 8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/4c397152/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e5a83db..0eb35a0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -74,7 +74,8 @@
 - unnecessary double-checking of window.sessionStorage in ponymail.js (#193)
 - lua scripts not using cross.contentType() compatibility function (#218)
 - code assumes that subject is always present in an e-mail (#149)
-- elastic.lua:getHeaders uses different sort field #146
+- elastic.lua:getHeaders uses different sort field (#146)
+- redundant matching of same string (#117)
 
 ## CHANGES in 0.9b:
 

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/4c397152/site/api/stats.lua
----------------------------------------------------------------------
diff --git a/site/api/stats.lua b/site/api/stats.lua
index 79d41c7..185bb8d 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -208,7 +208,7 @@ function handle(r)
         get.s = get.d
         get.e = get.d
     end
-    if get.d and get.d:match("lte=.+") then
+    if get.d then
         local lte = get.d:match("lte=([0-9]+[wMyd])")
         if lte then
             daterange.lte = "now+1d"
@@ -216,7 +216,7 @@ function handle(r)
             daterange.gt = nil
         end
     end
-    if get.d and get.d:match("gte=.+") then
+    if get.d then
         local gte = get.d:match("gte=([0-9]+[wMyd])")
         if gte then
             daterange.gte = nil
@@ -224,14 +224,14 @@ function handle(r)
             daterange.lte = "now-" .. gte
         end
     end
-    if get.d and get.d:match("dfr=.+") then
+    if get.d then
         local y,m,d = get.d:match("dfr=(%d+)%-(%d+)%-(%d+)")
         if y and m and d then
             daterange.gte = ("%04u/%02u/%02u 00:00:00"):format(y,m,d)
             daterange.gt = nil
         end
     end
-    if get.d and get.d:match("dto=.+") then
+    if get.d then
         local y,m,d = get.d:match("dto=(%d+)%-(%d+)%-(%d+)")
         if y and m and d then
             daterange.lte = ("%04u/%02u/%02u 23:59:59"):format(y,m,d)


Mime
View raw message