-
Notifications
You must be signed in to change notification settings - Fork 0
fix: load cancelable + graph redudant #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,7 +136,7 @@ func DumpForestToFile(m *InMemoryMatcher, filename string) error { | |
| // Tenant header | ||
| graphLines = append(graphLines, fmt.Sprintf("# Tenant: %s", tenantKey)) | ||
| mappingLines = append(mappingLines, fmt.Sprintf("# Tenant: %s", tenantKey)) | ||
| graphs, relationship := make(map[string]bool), "" | ||
| graphs, relationship := make(map[string]any), "" | ||
|
|
||
| // Snapshot NodeRelationships under forest lock | ||
| forest.mu.RLock() | ||
|
|
@@ -145,6 +145,7 @@ func DumpForestToFile(m *InMemoryMatcher, filename string) error { | |
| for rid, next := range trans { | ||
| relationship = fmt.Sprintf("%s %s", current, next) | ||
| if _, ok := graphs[relationship]; !ok { | ||
| graphs[relationship] = nil | ||
|
||
| graphLines = append(graphLines, relationship) | ||
| } | ||
| b.WriteString(rid) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -70,7 +70,7 @@ func newInMemoryMatcherWithContext(ctx context.Context, cancel context.CancelFun | |||||
| eventsChan: make(chan *Event, 100), | ||||||
| nodeID: nodeID, | ||||||
| snapshotChanged: 0, // Initialize atomic flag to 1 (no changes) | ||||||
| ctx: ctx, | ||||||
| ctx: context.Background(), | ||||||
|
||||||
| ctx: context.Background(), | |
| ctx: ctx, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from
map[string]booltomap[string]anywith nil values is unnecessary and reduces type safety. The original boolean map approach was cleaner - the presence of a key in the map already indicates the relationship exists, making the value irrelevant.