one more optimization.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29308 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-03-26 21:27:01 +00:00
1 parent f43ecdd93e
commit 987ff580e2
1 file changed
+4 -1
@@ -74,7 +74,10 @@ public class StreamTaskListener implements TaskListener, Serializable, Closeable
public StreamTaskListener(OutputStream out, Charset charset) {
try {
this.out = charset==null ? new PrintStream(out,false) : new PrintStream(out,false,charset.name());
if (charset == null)
this.out = (out instanceof PrintStream) ? (PrintStream)out : new PrintStream(out, false);
else
this.out = new PrintStream(out, false, charset.name());
this.charset = charset;
} catch (UnsupportedEncodingException e) {
// it's not very pretty to do this, but otherwise we'd have to touch too many call sites.