Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteicher2006-05-29 08:52:25 +0000
committerteicher2006-05-29 08:52:25 +0000
commit73db6c36f20bf9b4e241086872cb2299ee9da253 (patch)
tree59dd1a99506c9e4e7588f77ac31de72ab5b5426d
parentc17bb5c5014ae667d3e3c5e429e4b3993f64f369 (diff)
downloadeclipse.platform.text-pre_3_3_work.tar.gz
eclipse.platform.text-pre_3_3_work.tar.xz
eclipse.platform.text-pre_3_3_work.zip
avoid garbage creation in EditDocument.get(int,int)pre_3_3_work
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java b/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java
index f0ebd2d58e1..7d8913da980 100644
--- a/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java
+++ b/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java
@@ -82,9 +82,7 @@ class EditDocument implements IDocument {
}
public String get(int offset, int length) throws BadLocationException {
- char[] result= new char[length];
- fBuffer.getChars(offset, offset + length, result, 0);
- return new String(result);
+ return fBuffer.substring(offset, offset + length);
}
public char getChar(int offset) throws BadLocationException {

Back to the top