Skip to content

Commit b2515ec

Browse files
committed
refactor: 精简代码
1 parent 6f1615f commit b2515ec

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/BootstrapBlazor/Components/Display/Display.razor.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,10 @@ private async Task<string> FormatText([DisallowNull] TValue value)
128128
private async Task<string> FormatValueString()
129129
{
130130
string? ret = Value?.ToString();
131-
if (!string.IsNullOrEmpty(ret))
131+
var lookup = await GetLookup();
132+
if (lookup != null)
132133
{
133-
var lookup = await GetLookup();
134-
if (lookup != null)
135-
{
136-
ret = lookup.FirstOrDefault(i => i.Value.Equals(ret, LookupStringComparison))?.Text;
137-
}
134+
ret = lookup.FirstOrDefault(i => i.Value.Equals(ret, LookupStringComparison))?.Text;
138135
}
139136
return ret ?? string.Empty;
140137
}

0 commit comments

Comments
 (0)