Optimize calls to org-is-habit-p
commitbca4ac99989cb010cf398ec27f72659cfeed0f52
authorMatt Lundin <mdl@imapmail.org>
Mon, 13 Dec 2010 01:16:55 +0000 (13 01:16 +0000)
committerCarsten Dominik <carsten.dominik@gmail.com>
Sun, 12 Dec 2010 21:26:23 +0000 (12 22:26 +0100)
treeca6ae0834efb62a2d884f256ea9489130fd6394e
parentb65ba05758f2720d3f8feb1fac9dc34213f6be92
Optimize calls to org-is-habit-p

* lisp/org-agenda.el: (org-agenda-get-scheduled) Don't call
  org-is-habit-p until after checking for for
  org-agenda-skip-scheduled-if-done.

Org-agenda-get-scheduled was calling org-is-habit-p on every scheduled
item (including DONE items when org-agenda-skip-scheduled-if-done was
set to t). Tweaking the timing of the test shaves some time off of
agenda construction when org-habit is loaded and
org-agenda-skip-scheduled-if-done is t.

Before:  org-is-habit-p  478         0.2434439999  0.0005092970
After:   org-is-habit-p  81          0.057944      0.0007153580
lisp/org-agenda.el