undf: assign 949-951; tiled map editor 3 CWE-407 defects
tiled-0001: mapdocument.cpp sortObjects/sortLayers/moveLayersUp/Down/duplicate QList.contains() inside iteration over all map layers/objects = O(N*S) Fix: QSet O(1) lookup. MEDIUM severity. 24x speedup at N=2000,S=1000. tiled-0002: mapobjectmodel.cpp classChanged QList.contains(tile) inside nested loop over all map objects = O(O*T) Fix: QSet O(1) lookup. MEDIUM severity. 14x speedup at O=2000,T=500. tiled-0003: editpolygontool.cpp updateHandles QList.contains() inside QHash iteration = O(H*S) Fix: QSet O(1) lookup. MEDIUM severity. 13x speedup at H=1000,S=500. 3/3 PASS. MOAD-0002/0003/0004/0005 CLEAN.
This commit is contained in:
parent
f85ccf9b99
commit
191f018d78
10 changed files with 354 additions and 1 deletions
16
defects/tiled-0002/patch/tiled-0002.patch
Normal file
16
defects/tiled-0002/patch/tiled-0002.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# UNDF: UNDF-2026-000000950
|
||||
--- a/src/tiled/mapobjectmodel.cpp
|
||||
+++ b/src/tiled/mapobjectmodel.cpp
|
||||
@@ -493,6 +493,7 @@ void MapObjectModel::classChanged(const QList<Object *> &objects)
|
||||
} else if (typeId == Object::TileType) {
|
||||
+ const QSet<Object *> objectSet(objects.begin(), objects.end());
|
||||
for (const Layer *layer : map()->objectGroups()) {
|
||||
auto objectGroup = static_cast<const ObjectGroup*>(layer);
|
||||
for (MapObject *mapObject : objectGroup->objects()) {
|
||||
if (mapObject->className().isEmpty())
|
||||
if (auto tile = mapObject->cell().tile())
|
||||
- if (objects.contains(tile))
|
||||
+ if (objectSet.contains(tile))
|
||||
affectedObjects.append(mapObject);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue