diff options
author | Jose Medrano <josmed@microsoft.com> | 2022-02-25 08:26:47 +0300 |
---|---|---|
committer | vs-mobiletools-engineering-service2 <valco@microsoft.com> | 2022-03-01 18:01:15 +0300 |
commit | ffe26ce676092e8cdc17505c48e17c07758bf1b2 (patch) | |
tree | 99791e49f6994b7167c2a07a9012985f9fe0196b | |
parent | 5bbe8d577617b6f6f0eaac3f06aebfba1a4553b0 (diff) |
Caches RowCount into variable to avoid unnecessary native calls on each iteration
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs index f8448ec..0f2cec0 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs @@ -123,7 +123,8 @@ namespace Xamarin.PropertyEditing.Mac NSView view; PropertyEditorControl ctrl = null; - for (; reverse ? row > 0 : row < TableView.RowCount; row += modifier) { + var rowCount = TableView.RowCount; + for (; reverse ? row > 0 : row < rowCount; row += modifier) { view = TableView.GetView (0, row, makeIfNecessary: false); if (view is PropertyEditorControl pec) { // This is to include the CategoryContainer |