Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 869c0bc

Browse files
committed
Don't iterate over TypeIdsWithinPipelineMap twice. Optimize so setIds are stotred within a pipeline
1 parent 96260e0 commit 869c0bc

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/ServiceStack.Redis/RedisClient.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -617,17 +617,12 @@ internal void RemoveTypeIds<T>(params T[] values)
617617
}
618618
}
619619

620+
// Called just after original Pipeline is closed.
620621
internal void AddTypeIdsRegisteredDuringPipeline()
621622
{
622623
foreach (var entry in registeredTypeIdsWithinPipelineMap)
623624
{
624-
var typeIdsSetKey = entry.Key;
625-
var registeredTypeIdsWithinPipeline = GetRegisteredTypeIdsWithinPipeline(typeIdsSetKey);
626-
627-
foreach (var id in entry.Value)
628-
{
629-
registeredTypeIdsWithinPipeline.Each(x => this.AddItemToSet(typeIdsSetKey, id));
630-
}
625+
AddRangeToSet(entry.Key, entry.Value.ToList());
631626
}
632627
registeredTypeIdsWithinPipelineMap = new Dictionary<string, HashSet<string>>();
633628
}
@@ -637,7 +632,6 @@ internal void ClearTypeIdsRegisteredDuringPipeline()
637632
registeredTypeIdsWithinPipelineMap = new Dictionary<string, HashSet<string>>();
638633
}
639634

640-
641635
public T GetById<T>(object id)
642636
{
643637
var key = UrnKey<T>(id);

0 commit comments

Comments
 (0)