Commit ac27d2d4 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

should be somewhat faster.


Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent ccbec6d7
......@@ -313,7 +313,6 @@ public class MoveFunctionRefactoring extends Refactoring {
}
private String createFunctionBody(final Def_Function fun, final Module module) {
String body2 = "";
try {
final IFile file = (IFile)module.getLocation().getFile();
final InputStream istream = file.getContents();
......@@ -323,23 +322,17 @@ public class MoveFunctionRefactoring extends Refactoring {
br.skip(startOffset);
final char[] contentBuf = new char[endOffset-startOffset];
br.read(contentBuf, 0, endOffset-startOffset);
//TODO maybe just initialize the string
for (final char c : contentBuf) {
body2 += c;
}
final String body2 = new String(contentBuf);
br.close();
istream.close();
return body2;
} catch (CoreException ce) {
ce.printStackTrace();
return "";
} catch (IOException ioe) {
ioe.printStackTrace();
return "";
}
return body2;
return "";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment