Refactor PatchTree and applyPatch for improved readability and logic consistency

- Restructured property change checks in PatchTree.build to enhance clarity and maintainability.
- Updated applyPatch to improve the handling of instance retrieval logic for removed instances.
- Simplified the findDuplicateNames function in diff.lua for better readability and consistency in handling duplicate names.
This commit is contained in:
Joe 2026-01-20 23:05:16 -06:00
parent d21331cb65
commit cd05690d8a
3 changed files with 38 additions and 36 deletions

View file

@ -29,7 +29,9 @@ local function applyPatch(instanceMap, patch)
for _, removedIdOrInstance in ipairs(patch.removed) do
-- Skip auto-created instances that shouldn't be synced
local instance = if Types.RbxId(removedIdOrInstance) then instanceMap.fromIds[removedIdOrInstance] else removedIdOrInstance
local instance = if Types.RbxId(removedIdOrInstance)
then instanceMap.fromIds[removedIdOrInstance]
else removedIdOrInstance
if instance and Config.ignoredClassNames[instance.ClassName] then
continue
end