opental-checkins
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OpenTAL-checkins] opental/PlacelessTranslationService Negotiator.py


From: Lalo Martins
Subject: Re: [OpenTAL-checkins] opental/PlacelessTranslationService Negotiator.py
Date: Sun, 26 Jan 2003 20:18:21 -0200
User-agent: Mutt/1.4i

On Sat, Jan 25, 2003 at 03:56:15AM -0500, Magnus Heino wrote:
> -        if not cache.has_key(langs):
> -            cache[langs] = self._getLanguage(langs, env)
> -        return cache[langs]
> +
> +        return cache.setdefault(langs, self._getLanguage(langs, env))

But in this case the cache is pointless, because the expensive
_getLanguage() method is called anyway.

(Fix in the works)

[]s,
                                               |alo
                                               +----
--
            Those who trade freedom for security
               lose both and deserve neither.
--
http://www.laranja.org/                mailto:address@hidden
         pgp key: http://www.laranja.org/pessoal/pgp

Eu jogo RPG! (I play RPG)         http://www.eujogorpg.com.br/
GNU: never give up freedom                 http://www.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]