From 222271a0b886e047915acccf3a556eaa43248f7b Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Sat, 11 Aug 2012 16:50:04 +0530 Subject: [PATCH] Memoization is not possible in a sane way. The memoized results of these functions cannot be saved in a global hash map, becuase these functions are always run in a subshell. Changes to variables in the subshell do not reflect in the main shell instance. We'd have to resort to use the `$REPLY` ways returning the result from these functions, if they were to be memoized. But that way of doing things sucks. Totally unreadable. So, just not memoizing. --- antigen.zsh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/antigen.zsh b/antigen.zsh index af8c80e..0350ed3 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -110,14 +110,8 @@ antigen-update () { -antigen-get-clone-dir () { # Takes a repo url and gives out the path that this url needs to be cloned # to. Doesn't actually clone anything. - # TODO: Memoize? - - # The url given. - local url="$1" - - # Echo the full path to the clone directory. echo -n $ADOTDIR/repos/ - echo "$url" | sed \ + echo "$1" | sed \ -e 's./.-SLASH-.g' \ -e 's.:.-COLON-.g' \ -e 's.|.-PIPE-.g' @@ -126,7 +120,6 @@ antigen-update () { -antigen-get-clone-url () { # Takes a repo's clone dir and gives out the repo's original url that was # used to create the given directory path. - # TODO: Memoize? echo "$1" | sed \ -e "s:^$ADOTDIR/repos/::" \ -e 's.-SLASH-./.g' \ -- 2.0.0