Skip to content

Commit a8ff608

Browse files
committed
Cleanup: default literal
1 parent 691baa9 commit a8ff608

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/Exceptionless/Extensions/EventExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Globalization;
44
using System.Linq;
@@ -318,13 +318,13 @@ public static void SetManualStackingKey(this Event ev, string title, string manu
318318

319319
public static T GetDataValue<T>(this Event ev, string key, IJsonSerializer serializer = null) {
320320
if(ev == null || String.IsNullOrEmpty(key) || !ev.Data.ContainsKey(key))
321-
return default(T);
321+
return default;
322322

323323
try {
324324
return ev.Data.GetValue<T>(key, serializer);
325325
} catch (Exception) { }
326326

327-
return default(T);
327+
return default;
328328
}
329329
}
330330

src/Exceptionless/Storage/IsolatedStorageObjectStorage.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66
using System.IO.IsolatedStorage;
77
using System.Linq;
88
using System.Reflection;
9-
using System.Text;
109
using System.Text.RegularExpressions;
1110
using Exceptionless.Dependency;
12-
using Exceptionless.Extensions;
13-
using Exceptionless.Models;
14-
using Exceptionless.Storage;
1511
using Exceptionless.Utility;
1612

1713
namespace Exceptionless.Storage {
1814
public class IsolatedStorageObjectStorage : IObjectStorage {
1915
private readonly object _lockObject = new object();
2016
private readonly IDependencyResolver _resolver;
21-
private static readonly Encoding _encodingUTF8NoBOM = new UTF8Encoding(false, true);
2217

2318
public IsolatedStorageObjectStorage(IDependencyResolver resolver) {
2419
_resolver = resolver;
@@ -40,7 +35,7 @@ public IEnumerable<string> GetObjects(string searchPattern = null, int? limit =
4035
stack.Push(initialDirectory);
4136
Regex searchPatternRegex = null;
4237
if (!String.IsNullOrEmpty(searchPattern))
43-
searchPatternRegex = new Regex("^" + Regex.Escape(searchPattern).Replace(Path.DirectorySeparatorChar + "*", ".*?").Replace(Path.AltDirectorySeparatorChar + "*", ".*?") + "$");
38+
searchPatternRegex = new Regex($"^{Regex.Escape(searchPattern).Replace(Path.DirectorySeparatorChar + "*", ".*?").Replace(Path.AltDirectorySeparatorChar + "*", ".*?")}$");
4439

4540
while (stack.Count > 0) {
4641
string dir = stack.Pop();
@@ -112,7 +107,7 @@ public T GetObject<T>(string path) where T : class {
112107
});
113108

114109
if (buffer == null || buffer.Length == 0)
115-
return default(T);
110+
return default;
116111
return _resolver.GetStorageSerializer().Deserialize<T>(new MemoryStream(buffer));
117112
} catch (Exception ex) {
118113
_resolver.GetLog().Error(ex.Message, exception: ex);

0 commit comments

Comments
 (0)