33 lines
1 KiB
Diff
33 lines
1 KiB
Diff
# UNDF: UNDF-2026-000000207
|
|
--- a/panda/src/pgraph/camera.h
|
|
+++ b/panda/src/pgraph/camera.h
|
|
@@ -27,6 +27,7 @@
|
|
#include "pandaNode.h"
|
|
#include "luse.h"
|
|
#include "small_vector.h"
|
|
+#include "pset.h"
|
|
|
|
...
|
|
|
|
- typedef small_vector<DisplayRegion *> DisplayRegions;
|
|
+ // Unordered set: O(1) add/remove/contains.
|
|
+ // Iteration order is irrelevant for this container (used only for ownership tracking).
|
|
+ typedef pset<DisplayRegion *> DisplayRegions;
|
|
DisplayRegions _display_regions;
|
|
|
|
--- a/panda/src/pgraph/camera.cxx
|
|
+++ b/panda/src/pgraph/camera.cxx
|
|
@@ -241,13 +241,11 @@ add_display_region(DisplayRegion *display_region) {
|
|
- _display_regions.push_back(display_region);
|
|
+ _display_regions.insert(display_region);
|
|
}
|
|
|
|
void Camera::
|
|
remove_display_region(DisplayRegion *display_region) {
|
|
- DisplayRegions::iterator dri =
|
|
- std::find(_display_regions.begin(), _display_regions.end(), display_region);
|
|
- if (dri != _display_regions.end()) {
|
|
- _display_regions.erase(dri);
|
|
- }
|
|
+ _display_regions.erase(display_region); // O(1) hash erase; no-op if absent
|
|
}
|