Skip to content

Commit

Permalink
chore: adds minor change to indexing component logic
Browse files Browse the repository at this point in the history
The ruleSet does not need to the map until
it is populated

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Nov 26, 2024
1 parent cd235ef commit a1f8a29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rules/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func (m *MemoryStore) indexComponent(component oscal112.DefinedComponent) Set[st
ruleSet, ok := m.nodes[ruleIdProp.Value]
if !ok {
ruleSet = extensions.RuleSet{}
m.nodes[ruleIdProp.Value] = ruleSet
}

// A check may or may not be registered.
Expand Down Expand Up @@ -133,7 +132,7 @@ func (m *MemoryStore) indexComponent(component oscal112.DefinedComponent) Set[st
m.byCheck[placeholderCheck.ID] = ruleSet.Rule.ID
}
rules.Add(ruleSet.Rule.ID)
m.nodes[ruleIdProp.Value] = ruleSet
m.nodes[ruleSet.Rule.ID] = ruleSet
}
if len(checkIds) != 0 {
m.checksByValidationComponent[component.Title] = checkIds
Expand Down

0 comments on commit a1f8a29

Please sign in to comment.