From e026e5570091b3eb81c619a4ec203b94f24b9acd Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 10 Mar 2018 16:31:57 +0100 Subject: tracker/steamvr: inconsequential cleanup --- tracker-steamvr/steamvr.cpp | 3 ++- tracker-steamvr/steamvr.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp index 689e0ba9..32cb6ed1 100644 --- a/tracker-steamvr/steamvr.cpp +++ b/tracker-steamvr/steamvr.cpp @@ -44,7 +44,6 @@ void device_list::fill_device_specs(QList& list) with_vr_lock([&](vr_t v, error_t) { list.clear(); - list.reserve(max_devices); pose_t device_states[max_devices]; @@ -120,6 +119,8 @@ device_list::device_list() void device_list::refresh_device_list() { + device_specs.clear(); + device_specs.reserve(max_devices); fill_device_specs(device_specs); } diff --git a/tracker-steamvr/steamvr.hpp b/tracker-steamvr/steamvr.hpp index 4ba4da6d..479f517f 100644 --- a/tracker-steamvr/steamvr.hpp +++ b/tracker-steamvr/steamvr.hpp @@ -52,7 +52,7 @@ struct device_list final static never_inline maybe_pose get_pose(int k); static QString strerror(error_t error); - static constexpr int max_devices = int(vr::k_unMaxTrackedDeviceCount); + static constexpr inline unsigned max_devices = vr::k_unMaxTrackedDeviceCount; template friend auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), error_t())); -- cgit v1.2.3