Browse Source
Merge pull request #3057 from MarchingCube/alloc-boxing
Misc boxing allocation removal.
pull/3060/head
Jumar Macato
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
7 additions and
5 deletions
-
samples/ControlCatalog/Pages/ListBoxPage.xaml.cs
-
samples/ControlCatalog/ViewModels/ItemsRepeaterPageViewModel.cs
-
src/Avalonia.Base/Utilities/SingleOrDictionary.cs
-
src/Avalonia.Controls/Calendar/DatePicker.cs
|
|
|
@ -78,7 +78,7 @@ namespace ControlCatalog.Pages |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private string GenerateItem() => $"Item {_counter++}"; |
|
|
|
private string GenerateItem() => $"Item {_counter++.ToString()}"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ namespace ControlCatalog.ViewModels |
|
|
|
public ItemsRepeaterPageViewModel() |
|
|
|
{ |
|
|
|
Items = new ObservableCollection<string>( |
|
|
|
Enumerable.Range(1, 100000).Select(i => $"Item {i}")); |
|
|
|
Enumerable.Range(1, 100000).Select(i => $"Item {i.ToString()}")); |
|
|
|
} |
|
|
|
|
|
|
|
public ObservableCollection<string> Items { get; } |
|
|
|
|
|
|
|
@ -38,7 +38,7 @@ namespace Avalonia.Utilities |
|
|
|
{ |
|
|
|
if (dictionary == null) |
|
|
|
{ |
|
|
|
if (!_singleValue.HasValue || !_singleValue.Value.Key.Equals(key)) |
|
|
|
if (!_singleValue.HasValue || !EqualityComparer<TKey>.Default.Equals(_singleValue.Value.Key, key)) |
|
|
|
{ |
|
|
|
value = default(TValue); |
|
|
|
return false; |
|
|
|
|
|
|
|
@ -1042,7 +1042,8 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
} |
|
|
|
DateTime? d = SetTextBoxValue(s); |
|
|
|
if (!SelectedDate.Equals(d)) |
|
|
|
|
|
|
|
if (SelectedDate != d) |
|
|
|
{ |
|
|
|
SelectedDate = d; |
|
|
|
} |
|
|
|
@ -1058,7 +1059,8 @@ namespace Avalonia.Controls |
|
|
|
else |
|
|
|
{ |
|
|
|
DateTime? d = SetTextBoxValue(_defaultText); |
|
|
|
if (!SelectedDate.Equals(d)) |
|
|
|
|
|
|
|
if (SelectedDate != d) |
|
|
|
{ |
|
|
|
SelectedDate = d; |
|
|
|
} |
|
|
|
|