Skip to content

Commit

Permalink
Fix spacing inconsistencies in ActivityOutputRegister.cs
Browse files Browse the repository at this point in the history
Resolved unnecessary whitespace issues and adjusted spacing around conditional statements to improve code readability and maintain consistency. These changes do not alter functionality but enhance the code's clarity and professional formatting.
  • Loading branch information
sfmskywalker committed Jan 21, 2025
1 parent 1ca8f2a commit 0bb183f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/modules/Elsa.Workflows.Core/Models/ActivityOutputRegister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ public void Record(ActivityExecutionContext activityExecutionContext, string? ou
outputName = outputDescriptor.Name;

var record = new ActivityOutputRecord(containerId, activityId, activityInstanceId, outputName, outputValue);

_recordsByActivityInstanceIdAndOutputName[CreateActivityInstanceIdLookupKey(activityInstanceId, outputName)] = record;

var scopedRecordsKey = CreateActivityIdLookupKey(activityId, outputName);

if(!_recordsByActivityIdAndOutputName.TryGetValue(scopedRecordsKey, out var scopedRecords))
if (!_recordsByActivityIdAndOutputName.TryGetValue(scopedRecordsKey, out var scopedRecords))
{
scopedRecords = new();
_recordsByActivityIdAndOutputName[scopedRecordsKey] = scopedRecords;
}

scopedRecords.Add(record);
}

Expand All @@ -77,8 +77,8 @@ public IEnumerable<ActivityOutputRecord> FindMany(string activityId, string? out
public object? FindOutputByActivityId(string activityId, string? outputName = null)
{
var key = CreateActivityIdLookupKey(activityId, outputName);
return !_recordsByActivityIdAndOutputName.TryGetValue(key, out var records)
? null
return !_recordsByActivityIdAndOutputName.TryGetValue(key, out var records)
? null
: records.FirstOrDefault()?.Value;
}

Expand All @@ -91,11 +91,11 @@ public IEnumerable<ActivityOutputRecord> FindMany(string activityId, string? out
public object? FindOutputByActivityInstanceId(string activityInstanceId, string? outputName = null)
{
var key = CreateActivityInstanceIdLookupKey(activityInstanceId, outputName);
return !_recordsByActivityInstanceIdAndOutputName.TryGetValue(key, out var record)
? null
return !_recordsByActivityInstanceIdAndOutputName.TryGetValue(key, out var record)
? null
: record.Value;
}

private string CreateActivityIdLookupKey(string activityId, string? outputName) => $"{activityId}:{outputName ?? DefaultOutputName}";
private string CreateActivityInstanceIdLookupKey(string activityInstanceId, string? outputName) => $"{activityInstanceId}:{outputName ?? DefaultOutputName}";
}

0 comments on commit 0bb183f

Please sign in to comment.