ilya-biryukov added inline comments.

================
Comment at: clangd/GlobalCompilationDatabase.cpp:137
+  // 'It' may be invalid at this point, recompute it.
+  It = Cached.find(File);
+  if (It != Cached.end())
----------------
sammccall wrote:
> `return try_emplace(File, std::move(Command)).second`?
> 
> (This has different behavior if the cache was filled while you unlocked, but 
> it's arguably the right behavior and doesn't really matter).
Thanks, good catch! We'd rather return the cached value rather than the 
computed one.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D48068



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to