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 125582 3877a7a5fdf6
parent 125581 1a0cd3aa1864
child 125583 160c727a336b
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [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;