Skip to content

Commit bed5200

Browse files
perf(Table): use ReferenceEqualityComparer instance (#6238)
* 缓存字典设置引用比较器 * 添加比较器 * chore: bump version 9.7.4-beta06 Co-Authored-By: Diego2098 <[email protected]> --------- Co-authored-by: Argo Zhang <[email protected]>
1 parent 2104888 commit bed5200

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.7.4-beta05</Version>
4+
<Version>9.7.4-beta06</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Table/Table.razor.Sort.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private int MultipleSelectColumnLeft()
229229

230230
private bool IsNotFixedColumn() => !(FixedExtendButtonsColumn && IsExtendButtonsInRowHeader) && !(GetVisibleColumns().FirstOrDefault()?.Fixed ?? false);
231231

232-
private ConcurrentDictionary<ITableColumn, bool> LastFixedColumnCache { get; } = new();
232+
private ConcurrentDictionary<ITableColumn, bool> LastFixedColumnCache { get; } = new(ReferenceEqualityComparer.Instance);
233233

234234
private bool IsLastColumn(ITableColumn col) => LastFixedColumnCache.GetOrAdd(col, col =>
235235
{
@@ -244,7 +244,7 @@ private bool IsLastColumn(ITableColumn col) => LastFixedColumnCache.GetOrAdd(col
244244

245245
private bool IsLastExtendButtonColumn() => IsExtendButtonsInRowHeader && !GetVisibleColumns().Any(i => i.Fixed);
246246

247-
private ConcurrentDictionary<ITableColumn, bool> FirstFixedColumnCache { get; } = new();
247+
private ConcurrentDictionary<ITableColumn, bool> FirstFixedColumnCache { get; } = new(ReferenceEqualityComparer.Instance);
248248

249249
private bool IsFirstColumn(ITableColumn col) => FirstFixedColumnCache.GetOrAdd(col, col =>
250250
{

src/BootstrapBlazor/Components/Table/TableToolbar.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class TableToolbar<TItem> : ComponentBase
2020
/// </summary>
2121
private readonly List<IToolbarComponent> _buttons = [];
2222

23-
private readonly ConcurrentDictionary<ButtonBase, bool> _asyncButtonStateCache = new();
23+
private readonly ConcurrentDictionary<ButtonBase, bool> _asyncButtonStateCache = new(ReferenceEqualityComparer.Instance);
2424

2525
/// <summary>
2626
/// Specifies the content to be rendered inside this

0 commit comments

Comments
 (0)