diff options
Diffstat (limited to 'ext/io/12_io.js')
-rw-r--r-- | ext/io/12_io.js | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/ext/io/12_io.js b/ext/io/12_io.js index 2a825e7f6..1bb8f9fba 100644 --- a/ext/io/12_io.js +++ b/ext/io/12_io.js @@ -93,27 +93,19 @@ function* iterSync( } function readSync(rid, buffer) { - if (buffer.length === 0) { - return 0; - } - - const nread = ops.op_read_sync(rid, buffer); - + if (buffer.length === 0) return 0; + const nread = core.readSync(rid, buffer); return nread === 0 ? null : nread; } async function read(rid, buffer) { - if (buffer.length === 0) { - return 0; - } - + if (buffer.length === 0) return 0; const nread = await core.read(rid, buffer); - return nread === 0 ? null : nread; } function writeSync(rid, data) { - return ops.op_write_sync(rid, data); + return core.writeSync(rid, data); } function write(rid, data) { |