[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    Re: r241088 - Use an early exit to improve readability. (NFC)
From:       Adrian Prantl <aprantl () apple ! com>
Date:       2015-06-30 18:43:26
Message-ID: 07B0B965-D959-44AB-B3C1-C932DB90C5BA () apple ! com
[Download RAW message or body]


> On Jun 30, 2015, at 11:09 AM, David Blaikie <dblaikie@gmail.com> wrote:
> 
> Oh, and, assuming this function isn't recursive (ie: the process of building the \
> DIModule doesn't cause other DIModules to be created/inserted into ModuleRefCache) \
> you can avoid doing two map lookups: 
> auto *&ModuleRef = ModuleRefCache[Mod.Signature];
> if (ModuleRef)
> return ModuleRef
> ...
> ModuleRef = ...;
> return ModuleRef;

Thanks for the hint — while it currently isn't recursive, I want to extend it to \
support submodules, which will have to create a decl context chain of all the parent \
modules prior to creating a submodule, so I'll skip this optimization for now.

-- adrian
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic