diff options
author | Marius Ungureanu <teromario@yahoo.com> | 2017-03-28 20:47:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 20:47:27 +0300 |
commit | 522676ea6126e743df6b108a194dc155f4e8519e (patch) | |
tree | ac459b894ab7dd2beb272715b5e4a96dd86374a0 /main/src/addins/MonoDevelop.Gettext | |
parent | 6e309ed367ebe2719c26e80409f43e2f88a7f019 (diff) |
Misc opt (#1960)
* [Core] Remove superfluous ToCharArray.
* [Perf] Optimize StringBuilder usage
Go through StringBuilder.Append(string) and StringBuilder.Append(object)
usages. As follows, we no longer concat strings before appending to a
stringbuilder, and we no longer box valueTypes which go through
Append(object).
* [Perf] Optimize StringBuilder.AppendLine
Most notable improvements are in AssemblyBrowser and Diff calculation.
* Fix feedback.
Diffstat (limited to 'main/src/addins/MonoDevelop.Gettext')
3 files changed, 4 insertions, 3 deletions
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs index a93f10b208..dededc1d45 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs @@ -976,7 +976,8 @@ namespace MonoDevelop.Gettext foreach (string line in value.Split (new string[] {Environment.NewLine}, StringSplitOptions.None)) { if (sb.Length != 0) sb.AppendLine (); - sb.Append ("# " + line); + sb.Append ("# "); + sb.Append (line); } this.Comment = sb.ToString (); } diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/CatalogParser.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/CatalogParser.cs index d5ad68ef27..5d4c1fe207 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/CatalogParser.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/CatalogParser.cs @@ -269,7 +269,7 @@ namespace MonoDevelop.Gettext if (line[0] == '\t') line = line.Substring (1); if (line[0] == '"' && line[line.Length - 1] == '"') { - str.Append (line.Substring (1, line.Length - 2)); + str.Append (line, 1, line.Length - 2); } else { if (ReadParam (line, "msgstr[", out dummy)) { pos = dummy.IndexOf (']'); diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs index e4cf95da77..6cf9844c1f 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs @@ -51,7 +51,7 @@ namespace MonoDevelop.Gettext StringBuilder files = new StringBuilder (); foreach (Translation t in project.Translations) { - files.Append ("\\\n\t" + t.FileName); + files.Append ("\\\n\t").Append (t.FileName); } string dir; |