-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with Dependencies order which could cause crashes on migrat…
…ion check.
- Loading branch information
Showing
8 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
core/src/commonMain/kotlin/maryk/core/properties/definitions/addDataModelToDependencySet.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package maryk.core.properties.definitions | ||
|
||
import maryk.core.definitions.MarykPrimitive | ||
|
||
internal fun IsDefinitionWithDataModel<*>.addDataModelToDependencySet( | ||
dependencySet: MutableList<MarykPrimitive> | ||
) { | ||
if (!dependencySet.contains(dataModel as MarykPrimitive)) { | ||
// First add it so cyclical deps are not looping | ||
dependencySet.add(dataModel as MarykPrimitive) | ||
dataModel.getAllDependencies(dependencySet) | ||
// Then remove and add it again to have dependencies in right order. This makes sure the dependents are in front | ||
dependencySet.remove(dataModel as MarykPrimitive) | ||
dependencySet.add(dataModel as MarykPrimitive) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters