From 8f41f1fa60587d77ad3ce2109fc03180488f49cc Mon Sep 17 00:00:00 2001
From: "Guillaume J. Charmes" <guillaume.charmes@dotcloud.com>
Date: Thu, 4 Apr 2013 18:12:54 -0700
Subject: [PATCH] Remove unused optimization that could lead in loosing the
 escape sequence

---
 utils.go | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/utils.go b/utils.go
index 398d6570bf..4d87bffc1b 100644
--- a/utils.go
+++ b/utils.go
@@ -344,15 +344,6 @@ func TruncateId(id string) string {
 
 // Code c/c from io.Copy() modified to handle escape sequence
 func CopyEscapable(dst io.Writer, src io.ReadCloser) (written int64, err error) {
-	// If the writer has a ReadFrom method, use it to do the copy.
-	// Avoids an allocation and a copy.
-	if rt, ok := dst.(io.ReaderFrom); ok {
-		return rt.ReadFrom(src)
-	}
-	// Similarly, if the reader has a WriteTo method, use it to do the copy.
-	if wt, ok := src.(io.WriterTo); ok {
-		return wt.WriteTo(dst)
-	}
 	buf := make([]byte, 32*1024)
 	for {
 		nr, er := src.Read(buf)
-- 
GitLab