mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Refactor line change calculations in PatchTree.build function for improved readability and maintainability.
This commit is contained in:
parent
a9a9d930d3
commit
4caac7a31c
1 changed files with 5 additions and 2 deletions
|
|
@ -263,7 +263,8 @@ function PatchTree.build(patch, instanceMap, changeListHeaders)
|
|||
-- Check if this is a Source property - count line differences
|
||||
if prop == "Source" and currentSuccess and incomingSuccess then
|
||||
hasSourceChange = true
|
||||
totalLineChanges, whitespaceLineChanges = WhitespaceUtil.CountLineDifferences(currentValue, incomingValue)
|
||||
totalLineChanges, whitespaceLineChanges =
|
||||
WhitespaceUtil.CountLineDifferences(currentValue, incomingValue)
|
||||
end
|
||||
|
||||
addProp(
|
||||
|
|
@ -279,7 +280,9 @@ function PatchTree.build(patch, instanceMap, changeListHeaders)
|
|||
changeInfo = {
|
||||
-- Line changes for Source (nil if no Source change)
|
||||
lineChanges = if hasSourceChange and totalLineChanges > 0 then totalLineChanges else nil,
|
||||
isWhitespaceOnly = hasSourceChange and totalLineChanges > 0 and totalLineChanges == whitespaceLineChanges,
|
||||
isWhitespaceOnly = hasSourceChange
|
||||
and totalLineChanges > 0
|
||||
and totalLineChanges == whitespaceLineChanges,
|
||||
-- Property changes (non-Source: Name, Attributes, etc.)
|
||||
propChanges = if propCount > 0 then propCount else nil,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue