Minor refactor to make VP writing more efficient

llvm-svn: 253994
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index fc7fc8a..b670902 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -166,10 +166,8 @@
   for (uint32_t S = 0; S < NumValueSites; S++) {
     uint32_t ND = Record.getNumValueDataForSite(ValueKind, S);
     SiteCountArray[S] = ND;
-    std::unique_ptr<InstrProfValueData[]> SrcVD =
-        Record.getValueForSite(ValueKind, S);
+    Record.getValueForSite(DstVD, ValueKind, S);
     for (uint32_t I = 0; I < ND; I++) {
-      DstVD[I] = SrcVD[I];
       switch (ValueKind) {
       case IPVK_IndirectCallTarget:
         DstVD[I].Value = IndexedInstrProf::ComputeHash(