Bug 819791 - Part 4: Remove an unnecessary TArray copy in OrientationObserver.cpp. r=mounir
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 18 Dec 2012 20:16:06 -0500
changeset 116469 3877a7a5fdf6040adf950d3a367971862dda252c
parent 116468 1a0cd3aa18645212d34e73cea7a80f65c9fc97d7
child 116470 160c727a336b0dd9b33183f46201488d92414716
push id19945
push userjlebar@mozilla.com
push dateWed, 19 Dec 2012 01:16:38 +0000
treeherdermozilla-inbound@1dfb85987ee0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs819791
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 819791 - Part 4: Remove an unnecessary TArray copy in OrientationObserver.cpp. r=mounir
widget/gonk/OrientationObserver.cpp
--- a/widget/gonk/OrientationObserver.cpp
+++ b/widget/gonk/OrientationObserver.cpp
@@ -195,17 +195,17 @@ OrientationObserver::ShutDown()
 
 void
 OrientationObserver::Notify(const hal::SensorData& aSensorData)
 {
   // Sensor will call us on the main thread.
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aSensorData.sensor() == hal::SensorType::SENSOR_ORIENTATION);
 
-  InfallibleTArray<float> values = aSensorData.values();
+  const InfallibleTArray<float>& values = aSensorData.values();
   // Azimuth (values[0]): the device's horizontal orientation
   // (0 degree is north). It's unused for screen rotation.
   float pitch = values[1];
   float roll = values[2];
 
   uint32_t rotation;
   if (roll > 45) {
     rotation = nsIScreen::ROTATION_90_DEG;