From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10246 invoked by alias); 13 Dec 2016 17:02:52 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40176 Received: (qmail 10958 invoked from network); 13 Dec 2016 17:02:52 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(133.208.100.2):SA:0(-3.8/5.0):. Processed in 0.932846 secs); 13 Dec 2016 17:02:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf01.biglobe.ne.jp designates 133.208.100.2 as permitted sender) X-Biglobe-Sender: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: caching mechanism and Re: PATCH Completion for _yum From: "Jun T." In-Reply-To: <6472.1481623850@hydra.kiddle.eu> Date: Wed, 14 Dec 2016 01:18:46 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: <61b3fb7c-4de6-d8da-29b4-b3802d98b162@mathphys.fsk.uni-heidelberg.de> <20161027013054.GA15799@fujitsu.shahaf.local2> <484fa75d-9361-df92-06b4-54fad37231f4@mathphys.fsk.uni-heidelberg.de> <98208.1478792966@hydra.kiddle.eu> <765413af-36a5-9afb-dd8a-7e1a39d05dde@mathphys.fsk.uni-heidelberg.de> <31607.1478915523@hydra.kiddle.eu> <75905.1479841546@hydra.kiddle.eu> <6472.1481623850@hydra.kiddle.eu> To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.1878.6) X-Biglobe-Spnum: 58561 2016/12/13 19:10, Oliver Kiddle wrote: >> if ( [[ ${+_dput_cfhosts} -eq 0 ]] || _cache_invalid dputhosts ) && = ! _retrieve_cache dputhosts; then >> - which makes no sense to me. >=20 > I went through correcting other cases of this particular broken logic. > Substituting instead this logic: > if (( ! $+_dput_cfhosts[1] )) && { _cache_invalid dputhosts || > ! _retrieve_cache dputhosts } I guess what is intended by the original code is to be sure to = regenerate the data if the cache is invalid, even if the variable _dput_cfhosts already exists in the current zsh. But, > Whether we want to be keeping caches also in a global variable is a > different question keeping the data in a variable may not be a good idea. Suppose one zsh (zsh-A), which is still running, has created a cache = long time ago (and the cache is now invalid). If another zsh refreshes the = cache, zsh-A will not refresh its _dput_cfhosts next time it needs it, since = the cache is now valid.