From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9f842cdf16abf4b9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.germany.com!news.belwue.de!news.uni-stuttgart.de!not-for-mail From: Stefan Bellon Newsgroups: comp.lang.ada Subject: Re: Ada.Containers.Indefinite_Hashed_Maps Date: Thu, 26 Apr 2007 14:55:01 +0200 Organization: Comp.Center (RUS), U of Stuttgart, FRG Message-ID: <20070426145501.7c080816@cube.tz.axivion.com> References: <1177510391.733055.133060@n35g2000prd.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: infosun2.rus.uni-stuttgart.de 1177592063 7224 129.69.226.25 (26 Apr 2007 12:54:23 GMT) X-Complaints-To: news@news.uni-stuttgart.de NNTP-Posting-Date: Thu, 26 Apr 2007 12:54:23 +0000 (UTC) X-Newsreader: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; i486-pc-linux-gnu) X-URL: http://www.axillion.de/ Xref: g2news1.google.com comp.lang.ada:15307 Date: 2007-04-26T14:55:01+02:00 List-Id: Maciej Sobczak wrote: > Jeffrey R. Carter wrote: > > > if Maps.Contains (Map, Some_Key) then > > Position := Maps.Find (Map, Key => Some_Key); > > You do the same key search once for Contains and once for Find. That > gives twice the same work. Is there a way to make the search once? Position := Maps.Find (Map, Key => Some_Key); if Position /= Maps.No_Element then ... Untested, but this is how I understand it. -- Stefan Bellon