Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortherzok <marius.ungureanu@xamarin.com>2017-05-29 14:19:40 +0300
committertherzok <marius.ungureanu@xamarin.com>2017-05-29 14:19:40 +0300
commit11206a0039385143de65594f901dafbfc2426f30 (patch)
treed4ab5b90fc171043eb70601bc1ca02ea42c0a16f /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem
parenteaa392aa2de53fa27fccbe71a20567b0632d932d (diff)
parentee08e85ba3e5e30cd0c4b4f51f640f522ebd3101 (diff)
Merge remote-tracking branch 'origin/master' into cecil-swap
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
index 2c877d5f69..77e20a11b3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
@@ -66,12 +66,13 @@ namespace MonoDevelop.Ide.TypeSystem
if (handler != null) {
lock (replaceLock) {
var oldText = CurrentText;
- var changes = new List<Microsoft.CodeAnalysis.Text.TextChange> ();
- var changeRanges = new List<TextChangeRange> ();
- foreach (var c in e.TextChanges) {
+ var changes = new Microsoft.CodeAnalysis.Text.TextChange[e.TextChanges.Count];
+ var changeRanges = new TextChangeRange[e.TextChanges.Count];
+ for (int i = 0; i < e.TextChanges.Count; ++i) {
+ var c = e.TextChanges[i];
var span = new TextSpan (c.Offset, c.RemovalLength);
- changes.Add (new Microsoft.CodeAnalysis.Text.TextChange (span, c.InsertedText.Text));
- changeRanges.Add (new TextChangeRange (span, c.InsertionLength));
+ changes[i] = new Microsoft.CodeAnalysis.Text.TextChange (span, c.InsertedText.Text);
+ changeRanges[i] = new TextChangeRange (span, c.InsertionLength);
}
var newText = oldText.WithChanges (changes);
currentText = newText;