refactor: change ValidSyntaxLanguages from string array to HashSet for improved performance

This commit is contained in:
2026-01-28 08:47:49 -05:00
parent 1af3c095c4
commit adcaaadd7e
2 changed files with 2 additions and 2 deletions
@@ -418,7 +418,7 @@ namespace SharpbinV3.Server.Controllers
{
return Ok(new PasteOptionsDto
{
Syntaxes = _pasteSettings.ValidSyntaxLanguages,
Syntaxes = [.. _pasteSettings.ValidSyntaxLanguages],
Visibilities =
[
new() { Value = 0, DisplayName = "Public" },
+1 -1
View File
@@ -4,7 +4,7 @@ namespace SharpbinV3.Server.Settings
{
public class PasteSettings
{
public string[] ValidSyntaxLanguages { get; set; } = [];
public HashSet<string> ValidSyntaxLanguages { get; set; } = [];
public int MaxTitleLength { get; set; } = 500;
public int MaxPasteSizeInBytes { get; set; } = 1_048_576; // 1 MB
public bool EnablePasteCompression { get; set; } = true;