Skip to content

Commit f4ae9de

Browse files
committed
refactor: 精简代码
1 parent 41be413 commit f4ae9de

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/BootstrapBlazor/Components/Typed/Typed.razor.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,27 @@ public async Task TriggerComplete()
7676

7777
private bool UpdateParameters()
7878
{
79-
var ret = false;
8079
if (Text != _text)
8180
{
8281
_text = Text;
83-
ret = true;
82+
return true;
8483
}
8584

86-
if (!ret)
85+
var optionString = GetOptionsString();
86+
if (string.Equals(optionString, _lastOptions, StringComparison.Ordinal))
8787
{
88-
var optionString = GetOptionsString();
89-
if (optionString != _lastOptions)
90-
{
91-
_lastOptions = optionString;
92-
}
93-
ret = true;
88+
return false;
9489
}
95-
return ret;
90+
91+
_lastOptions = optionString;
92+
return true;
9693
}
9794

98-
private string GetOptionsString()
95+
private string? GetOptionsString()
9996
{
100-
var ret = "";
10197
if (Options == null)
10298
{
103-
return ret;
99+
return null;
104100
}
105101

106102
var textString = Options.Text == null ? "" : string.Join(",", Options.Text);

0 commit comments

Comments
 (0)