From: Stefan Bellon <sbellon@sbellon.de>
Subject: Re: Ada.Containers.Indefinite_Hashed_Maps
Date: Thu, 26 Apr 2007 14:55:01 +0200
Date: 2007-04-26T14:55:01+02:00 [thread overview]
Message-ID: <20070426145501.7c080816@cube.tz.axivion.com> (raw)
In-Reply-To: f0q4v5$aj2$1@cernne03.cern.ch
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
next prev parent reply other threads:[~2007-04-26 12:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 14:13 Ada.Containers.Indefinite_Hashed_Maps markp
2007-04-25 17:43 ` Ada.Containers.Indefinite_Hashed_Maps Jeffrey R. Carter
2007-04-26 12:12 ` Ada.Containers.Indefinite_Hashed_Maps Maciej Sobczak
2007-04-26 12:55 ` Stefan Bellon [this message]
2007-04-26 16:13 ` Ada.Containers.Indefinite_Hashed_Maps Matthew Heaney
2007-04-27 4:39 ` Ada.Containers.Indefinite_Hashed_Maps Jeffrey R. Carter
2007-04-26 15:52 ` Ada.Containers.Indefinite_Hashed_Maps Matthew Heaney
2007-04-26 19:56 ` Ada.Containers.Indefinite_Hashed_Maps Matthew Heaney
2007-04-26 16:12 ` Ada.Containers.Indefinite_Hashed_Maps Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox