Skip to content

Commit 952ff67

Browse files
committed
fix(Dashboard): improved code style
Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
1 parent c71a621 commit 952ff67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dashboard/Synapse.Dashboard/Services/SpecificationSchemaManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Synapse.Dashboard.Services;
2323
public class SpecificationSchemaManager(IYamlSerializer yamlSerializer, HttpClient httpClient)
2424
{
2525

26-
Dictionary<string, string> _knownSchemas = new Dictionary<string, string>();
26+
readonly Dictionary<string, string> _knownSchemas = [];
2727

2828
string? _latestVersion = null;
2929

@@ -56,7 +56,7 @@ public async Task<string> GetLatestVersion()
5656
/// <returns>A awaitable task</returns>
5757
public async Task<string> GetSchema(string version)
5858
{
59-
if (this._knownSchemas.ContainsKey(version)) return this._knownSchemas[version];
59+
if (_knownSchemas.TryGetValue(version, out string? value)) return value;
6060
var address = $"https://raw.githubusercontent.com/serverlessworkflow/specification/{version}/schema/workflow.yaml";
6161
var yamlSchema = await this.HttpClient.GetStringAsync(address);
6262
this._knownSchemas.Add(version, this.YamlSerializer.ConvertToJson(yamlSchema));

0 commit comments

Comments
 (0)