Skip to content

Commit 70f0517

Browse files
author
David Karlaš
authored
Merge pull request #104 from mono/Therzok-patch-1
Remove some extra string allocations on getting a display type name d…
2 parents 64e5a5e + cfea890 commit 70f0517

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Mono.Debugger.Soft/Mono.Debugger.Soft/MethodMirror.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public string FullName {
5959
sb.Append (ReturnType.Name);
6060
sb.Append (' ');
6161
if (type_namespace != String.Empty)
62-
sb.Append (type_namespace + ".");
62+
sb.Append (type_namespace).Append (".");
6363
sb.Append(type_name);
6464
sb.Append(":");
6565
sb.Append(Name);

Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ string GetDisplayTypeName (string typeName, int startIndex, int endIndex)
193193
next = genericEndIndex;
194194

195195
// Append the next generic type component
196-
builder.Append (typeName.Substring (i, next - i));
196+
builder.Append (typeName, i, next - i);
197197

198198
i = next + 1;
199199
}
@@ -1266,7 +1266,7 @@ public string EvaluateDisplayString (EvaluationContext ctx, object obj, string e
12661266
int last = 0;
12671267

12681268
while (i != -1 && i < expr.Length) {
1269-
display.Append (expr.Substring (last, i - last));
1269+
display.Append (expr, last, i - last);
12701270
i++;
12711271

12721272
int j = expr.IndexOf ('}', i);
@@ -1308,7 +1308,7 @@ public string EvaluateDisplayString (EvaluationContext ctx, object obj, string e
13081308
if (str == null)
13091309
display.Append ("null");
13101310
else if (noquotes && IsQuoted (str))
1311-
display.Append (str.Substring (1, str.Length - 2));
1311+
display.Append (str, 1, str.Length - 2);
13121312
else
13131313
display.Append (str);
13141314
} else {

0 commit comments

Comments
 (0)