std::vector is more appropriate than nsRefPtrHashtable for VRManager::mVRDisplays. This is a remnant from prior refactoring. Rationale for using the hashmap was that due to hardware hot-swapping, there will not always be a 1:1 relationship between the vector index and the displayid used for the entry. The benefits of the hashmap are limited; however, as there is expected to be < 10 entries in the most extreme case. Iterating over the small std::vector is probably faster than the hashmap. In the pre-WebVR 1.0 API, this map was also going to hold individual sensors and controllers which could greatly increase the length of the array. This is no longer the case as these have been moved out to Gamepad API.
Whiteboard: [gfx-noted] → [gfx-noted][webvr]
You need to log in before you can comment on or make changes to this bug.