From 1947a25ff8aa932a2b694838a2c5de6fe698b882 Mon Sep 17 00:00:00 2001 From: Scott Freeman Date: Wed, 15 Jan 2020 12:36:31 -0500 Subject: [PATCH] Making a few improvements in Grapher (#922) - Removed unused variable - Using ArrayReference in GetGraphBitmapStream so bytes aren't copied an extra time --- src/GraphControl/Control/Grapher.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/GraphControl/Control/Grapher.cpp b/src/GraphControl/Control/Grapher.cpp index 4da2123..2901de7 100644 --- a/src/GraphControl/Control/Grapher.cpp +++ b/src/GraphControl/Control/Grapher.cpp @@ -198,7 +198,6 @@ namespace GraphControl KeyGraphFeaturesInfo ^ Grapher::AnalyzeEquation(Equation ^ equation) { - auto result = ref new KeyGraphFeaturesInfo(); if (auto graph = GetGraph(equation)) { if (auto analyzer = graph->GetAnalyzer()) @@ -652,9 +651,9 @@ namespace GraphControl hr = renderer->GetBitmap(BitmapOut, hasSomeMissingDataOut); if (SUCCEEDED(hr)) { - // Get the raw date + // Get the raw data vector byteVector = BitmapOut->GetData(); - auto arr = ref new Array(&byteVector[0], (unsigned int)byteVector.size()); + auto arr = ArrayReference(byteVector.data(), (unsigned int)byteVector.size()); // create a memory stream wrapper InMemoryRandomAccessStream ^ stream = ref new InMemoryRandomAccessStream();