summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-06-13 13:57:52 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-13 14:35:13 -0700
commit5e0018cdc3844994bf4afdc0a5e6ae90636c9967 (patch)
treed052f9fcc28e5f720660cb9ba2d2f8aa79a323c5
parent8902e28e9b252d53079635e28151199feaf2ea84 (diff)
downloadqtlocation-mapboxgl-5e0018cdc3844994bf4afdc0a5e6ae90636c9967.tar.gz
[core] Add consts
-rw-r--r--src/mbgl/renderer/frame_history.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/renderer/frame_history.cpp b/src/mbgl/renderer/frame_history.cpp
index 35e246f488..869222b4eb 100644
--- a/src/mbgl/renderer/frame_history.cpp
+++ b/src/mbgl/renderer/frame_history.cpp
@@ -37,9 +37,9 @@ void FrameHistory::record(const TimePoint& now, float zoom, const Duration& dura
}
for (int16_t z = 0; z <= 255; z++) {
- std::chrono::duration<float> timeDiff = now - changeTimes[z];
- int32_t opacityChange = (duration == Milliseconds(0) ? 1 : (timeDiff / duration)) * 255;
- uint8_t opacity = z <= zoomIndex
+ const std::chrono::duration<float> timeDiff = now - changeTimes[z];
+ const int32_t opacityChange = (duration == Milliseconds(0) ? 1 : (timeDiff / duration)) * 255;
+ const uint8_t opacity = z <= zoomIndex
? util::min(255, changeOpacities[z] + opacityChange)
: util::max(0, changeOpacities[z] - opacityChange);
if (opacities.data[z] != opacity) {