From 7a5e5bb8be296195b7c1a1aebf09bbfd26a3f712 Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Wed, 7 Jun 2023 13:00:30 -0700 Subject: [PATCH 1/2] Remove default struct constructors --- .../Internal/FastSerialization/GrowableArray.cs | 13 +------------ src/Sentry/Internal/SparseArray.cs | 8 +------- test/Sentry.Tests/Protocol/ProfilerTests.verify.cs | 2 +- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/Sentry/Internal/FastSerialization/GrowableArray.cs b/src/Sentry/Internal/FastSerialization/GrowableArray.cs index 1c99541b67..5c606afeef 100644 --- a/src/Sentry/Internal/FastSerialization/GrowableArray.cs +++ b/src/Sentry/Internal/FastSerialization/GrowableArray.cs @@ -10,11 +10,6 @@ internal struct HashableGrowableArray : IReadOnlyList, IEquatable(); - } - public HashableGrowableArray(int capacity) { _items = new GrowableArray(capacity); @@ -95,13 +90,7 @@ public bool Equals(HashableGrowableArray other) internal struct GrowableArray : IReadOnlyList { /// - /// Create an empty growable array. - /// - public GrowableArray() : this(0) { } - - /// - /// Create a growable array with the given initial size it will grow as needed. There is also the - /// default constructor that assumes initialSize of 0 (and does not actually allocate the array. + /// Create a growable array with the given initial size it will grow as needed. /// /// public GrowableArray(int initialSize) diff --git a/src/Sentry/Internal/SparseArray.cs b/src/Sentry/Internal/SparseArray.cs index e4becdfae5..4441ce85f7 100644 --- a/src/Sentry/Internal/SparseArray.cs +++ b/src/Sentry/Internal/SparseArray.cs @@ -9,13 +9,7 @@ internal sealed class SparseScalarArray where T : IEquatable private GrowableArray _items; private T _uninitializedValue; - public SparseScalarArray(T uninitializedValue) - { - _items = new GrowableArray(); - _uninitializedValue = uninitializedValue; - } - - public SparseScalarArray(T uninitializedValue, int capacity) + public SparseScalarArray(T uninitializedValue, int capacity = 0) { _items = new GrowableArray(capacity); _uninitializedValue = uninitializedValue; diff --git a/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs b/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs index fbf28e37ea..e1c31cd147 100644 --- a/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs +++ b/test/Sentry.Tests/Protocol/ProfilerTests.verify.cs @@ -12,7 +12,7 @@ public ProfilerTests(ITestOutputHelper output) private static void AddStack(SampleProfile sut, List frames) { - var stack = new HashableGrowableArray(); + var stack = new HashableGrowableArray(0); foreach (var frame in frames) { stack.Add(frame); From 1796fd34f4cd1042626eb7a1480f1f99b73e54a4 Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Wed, 7 Jun 2023 14:31:48 -0700 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcf725835..0714ffb55d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Reduce debug files uploaded ([#2404](https://github.com/getsentry/sentry-dotnet/pull/2404)) - Fix system frames being marked as "in-app" ([#2408](https://github.com/getsentry/sentry-dotnet/pull/2408)) - NOTE: This important fix corrects a value that is used during issue grouping, so you may receive new alerts for existing issues after deploying this update. +- Fix UWP GateKeeper errors ([#2415](https://github.com/getsentry/sentry-dotnet/pull/2415)) ### Dependencies