On Aug 21, 2012, at 4:01 PM, Benjamin Kramer <[email protected]> wrote:
> On 22.08.2012, at 00:53, Ted Kremenek <[email protected]> wrote: > >>> - bool AddToWorkList(const MemRegion *R, RegionCluster &C) { >>> - if (unsigned &visited = Visited[&C]) >>> - return false; >>> - else >>> - visited = 1; >>> + bool AddToWorkList(const MemRegion *R, const ClusterBindings *C) { >>> + if (C) { >>> + if (Visited.count(C)) >>> + return false; >>> + Visited.insert(C); >>> + } >> >> If Visited was still a DenseMap this lookup-and-modify would require only >> one lookup, and a modify of the value in place. > > SmallPtrSet can do this with a single lookup, too. Insert() returns a > boolean whether the insert was successful, i.e. the entry wasn't > already in the set. Perfect! Refined in r162330. Thanks! _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
