[PATCH] D25645: [ADT] Add CachedHashString.

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 15:32:18 PDT 2016


timshen added inline comments.


================
Comment at: llvm/include/llvm/ADT/CachedHashString.h:117
+  CachedHashString &operator=(const CachedHashString &Other) {
+    if (!isEmptyOrTombstone())
+      delete[] P;
----------------
How do you feel about this:
  if (this != Other) {
    ~CachedHashString();
    new (this) CachedHashString(Other);
  }
  return *this;

Likewise for the move assign.


https://reviews.llvm.org/D25645





More information about the llvm-commits mailing list