summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/frame_history.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2015-07-13 15:15:50 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2015-07-14 16:48:34 +0300
commit2aad2f4e14ab762847141788e725d50e1ee44ace (patch)
tree5f814850425b8bc0908a2c9de04916c1f85e22e1 /src/mbgl/renderer/frame_history.cpp
parent7d8b4dc6c0714aa43a85a56ea32fa5590dd843e6 (diff)
downloadqtlocation-mapboxgl-2aad2f4e14ab762847141788e725d50e1ee44ace.tar.gz
Pass {Duration,TimePoint} by const ref if possible
Diffstat (limited to 'src/mbgl/renderer/frame_history.cpp')
-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 478520c510..cb36a1d834 100644
--- a/src/mbgl/renderer/frame_history.cpp
+++ b/src/mbgl/renderer/frame_history.cpp
@@ -3,7 +3,7 @@
using namespace mbgl;
// Record frame history that will be used to calculate fading params
-void FrameHistory::record(TimePoint now, float zoom) {
+void FrameHistory::record(const TimePoint& now, float zoom) {
// first frame ever
if (!history.size()) {
history.emplace_back(FrameSnapshot{TimePoint::min(), zoom});
@@ -15,7 +15,7 @@ void FrameHistory::record(TimePoint now, float zoom) {
}
}
-bool FrameHistory::needsAnimation(const Duration duration) const {
+bool FrameHistory::needsAnimation(const Duration& duration) const {
if (!history.size()) {
return false;
}
@@ -47,7 +47,7 @@ bool FrameHistory::needsAnimation(const Duration duration) const {
return false;
}
-FadeProperties FrameHistory::getFadeProperties(Duration duration) {
+FadeProperties FrameHistory::getFadeProperties(const Duration& duration) {
const TimePoint currentTime = Clock::now();
// Remove frames until only one is outside the duration, or until there are only three