[llvm-commits] [llvm] r89974 - /llvm/trunk/lib/VMCore/Metadata.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Fri Nov 27 11:43:18 PST 2009
On Thu, 2009-11-26 at 22:54 +0000, Nick Lewycky wrote:
> Author: nicholas
> Date: Thu Nov 26 16:54:26 2009
> New Revision: 89974
>
> URL: http://llvm.org/viewvc/llvm-project?rev=89974&view=rev
> Log:
> Clean up file, no functionality change.
>
> Modified:
> llvm/trunk/lib/VMCore/Metadata.cpp
>
> Modified: llvm/trunk/lib/VMCore/Metadata.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=89974&r1=89973&r2=89974&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/VMCore/Metadata.cpp (original)
> +++ llvm/trunk/lib/VMCore/Metadata.cpp Thu Nov 26 16:54:26 2009
> @@ -33,10 +33,8 @@
> StringMapEntry<MDString *> &Entry =
> pImpl->MDStringCache.GetOrCreateValue(Str);
> MDString *&S = Entry.getValue();
> - if (S) return S;
> -
> - return S =
> - new MDString(Context, Entry.getKey());
> + if (!S) S = new MDString(Context, Entry.getKey());
> + return S;
> }
>
> MDString *MDString::get(LLVMContext &Context, const char *Str) {
> @@ -44,10 +42,8 @@
> StringMapEntry<MDString *> &Entry =
> pImpl->MDStringCache.GetOrCreateValue(Str ? StringRef(Str) : StringRef());
> MDString *&S = Entry.getValue();
> - if (S) return S;
> -
> - return S =
> - new MDString(Context, Entry.getKey());
> + if (!S) new MDString(Context, Entry.getKey());
> + return S;
Did you miss a "S = " here?
- return S =
- new MDString(Context, Entry.getKey());
+ if (!S) S = new MDString(Context, Entry.getKey());
^^^^
Tobi
More information about the llvm-commits
mailing list