Skip to content

Commit bf5e606

Browse files
committed
Don't new Buffer again
1 parent f4288f7 commit bf5e606

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

qiniu/io.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ function PutExtra(params, mimeType, crc32, checkCrc) {
2727
function PutRet(hash, key) {
2828
this.hash = hash || null;
2929
this.key = key || null;
30-
}
30+
}
3131

32-
// onret: callback function instead of ret
32+
// onret: callback function instead of ret
3333
function put(uptoken, key, body, extra, onret) {
3434
if(!extra) {
3535
extra = new PutExtra();
@@ -60,7 +60,7 @@ function getMultipart(uptoken, key, body, extra) {
6060
form.field('key', key);
6161
}
6262

63-
form.buffer('file', new Buffer(body), key, extra.mimeType);
63+
form.buffer('file', body, key, extra.mimeType);
6464

6565
//extra['checkcrc']
6666
if (extra.checkCrc == 1) {
@@ -100,4 +100,3 @@ function putFile(uptoken, key, loadFile, extra, onret) {
100100
function putFileWithoutKey(uptoken, loadFile, extra, onret) {
101101
putFile(uptoken, null, loadFile, extra, onret);
102102
}
103-

0 commit comments

Comments
 (0)