From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Guerry Subject: [Accepted] [O, 1/3] Replace recursive implementation with an iterative one Date: Tue, 22 Mar 2011 10:46:10 +0100 (CET) Message-ID: <20110322094610.24BFE64AF@myhost.localdomain> References: <1300720268-9375-2-git-send-email-christian.egli@alumni.ethz.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=50870 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1yAa-0001JO-Ti for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 05:46:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1yAZ-00089U-Gv for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 05:46:32 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:53033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1yAZ-00089M-B0 for emacs-orgmode@gnu.org; Tue, 22 Mar 2011 05:46:31 -0400 Received: by bwz17 with SMTP id 17so6496555bwz.0 for ; Tue, 22 Mar 2011 02:46:30 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Patch 707 (http://patchwork.newartisans.com/patch/707/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3C1300720268-9375-2-git-send-email-christian.egli%40alumni.ethz.ch%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O,1/3] Replace recursive implementation with an iterative one > Date: Mon, 21 Mar 2011 20:11:06 -0000 > From: Christian Egli > X-Patchwork-Id: 707 > Message-Id: <1300720268-9375-2-git-send-email-christian.egli@alumni.ethz.ch> > To: emacs-orgmode@gnu.org > Cc: Christian Egli > > From: Christian Egli > > * org-taskjuggler.el (org-taskjuggler-assign-resource-ids): Replace > recursive implementation with an iterative one. > > That way we can avoid to have ask users to increase > `max-lisp-eval-depth'. > > --- > lisp/org-taskjuggler.el | 16 +++++++--------- > 1 files changed, 7 insertions(+), 9 deletions(-) > > diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el > index 9c88f5d..279f46d 100644 > --- a/lisp/org-taskjuggler.el > +++ b/lisp/org-taskjuggler.el > @@ -418,15 +418,13 @@ deeper), then it's not a leaf." > (defun org-taskjuggler-assign-resource-ids (resources) > "Given a list of resources return the same list, assigning a > unique id to each resource." > - (cond > - ((null resources) nil) > - (t > - (let* ((resource (car resources)) > - (unique-id (org-taskjuggler-get-unique-id resource unique-ids))) > - (push (cons "unique-id" unique-id) resource) > - (cons resource > - (org-taskjuggler-assign-resource-ids (cdr resources) > - (cons unique-id unique-ids))))))) > + (let (unique-ids new-list) > + (dolist (resource resources new-list) > + (let ((unique-id (org-taskjuggler-get-unique-id resource unique-ids))) > + (push (cons "unique-id" unique-id) resource) > + (push unique-id unique-ids) > + (push resource new-list))) > + (nreverse new-list))) > > (defun org-taskjuggler-resolve-dependencies (tasks) > (let ((previous-level 0) >