Skip to content

Commit baa393d

Browse files
committed
Version 2.1.3: Legacy API update
1 parent 20bd759 commit baa393d

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

Runtime/Extensions/StringExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal static string OnlyLetters(this string source)
1717
{
1818
return string.Empty;
1919
}
20-
return string.Concat(source.Where(n => char.IsLetter(n)));
20+
return new string(source.Where(n => char.IsLetter(n)).ToArray());
2121
}
2222

2323
/// <summary>

Runtime/Model/BacktraceSourceCode.cs

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
using Backtrace.Newtonsoft.Linq;
22
using System;
3-
using System.Collections.Generic;
43
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
4+
using System.Net.Mime;
75

86
namespace Backtrace.Unity.Model
97
{
108
public class BacktraceSourceCode
119
{
1210
public string Id = Guid.NewGuid().ToString();
13-
public string Type { get; set; } = "Text";
14-
public string Title { get; set; } = "Log File";
11+
public readonly string Type = "Text";
12+
public readonly string Title = "Log File";
1513

1614
public bool HighlightLine = false;
1715
public string Text { get; set; }
1816

17+
public BacktraceSourceCode()
18+
{
19+
Type = "Text";
20+
Title = "Log File";
21+
}
22+
1923
internal BacktraceJObject ToJson()
2024
{
2125
var json = new BacktraceJObject();
22-
json[Id.ToString()] = new BacktraceJObject()
23-
{
24-
["id"] = Id,
25-
["type"] = Type,
26-
["title"] = Title,
27-
["highlightLine"] = HighlightLine,
28-
["text"] = Text,
29-
};
26+
var sourceCode = new BacktraceJObject();
27+
sourceCode["id"] = Id;
28+
sourceCode["type"] = Type;
29+
sourceCode["title"] = Title;
30+
sourceCode["highlightLine"] = HighlightLine;
31+
sourceCode["text"] = Text;
3032

33+
json[Id.ToString()] = sourceCode;
3134
return json;
3235
}
3336

@@ -46,9 +49,7 @@ internal static BacktraceSourceCode Deserialize(JToken token)
4649
var sourceCode = new BacktraceSourceCode()
4750
{
4851
Id = rawSourceCode.Value<string>("id"),
49-
Text = rawSourceCode.Value<string>("text"),
50-
Title = rawSourceCode.Value<string>("title"),
51-
Type = rawSourceCode.Value<string>("type")
52+
Text = rawSourceCode.Value<string>("text")
5253
};
5354
return sourceCode;
5455
}

Runtime/Model/DeduplicationModel.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Collections.Generic;
44
using System.Linq;
55
using System.Text;
6-
using UnityEngine;
76

87
namespace Backtrace.Unity.Model
98
{
@@ -69,7 +68,7 @@ public string Factor
6968
{
7069
get
7170
{
72-
if(_backtraceData.Report == null)
71+
if (_backtraceData.Report == null)
7372
{
7473
return string.Empty;
7574
}

0 commit comments

Comments
 (0)