| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6fefd51 commit 89c3273
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1112,14 +1112,18 @@ function adjustOffset(offset, length) { | |||
| 1112 | 1112 | return NumberIsNaN(offset) ? 0 : length; | |
| 1113 | 1113 | } | |
| 1114 | 1114 | ||
| 1115 | - Buffer.prototype.slice = function slice(start, end) { | ||
| 1115 | + Buffer.prototype.subarray = function subarray(start, end) { | ||
| 1116 | 1116 | const srcLength = this.length; | |
| 1117 | 1117 | start = adjustOffset(start, srcLength); | |
| 1118 | 1118 | end = end !== undefined ? adjustOffset(end, srcLength) : srcLength; | |
| 1119 | 1119 | const newLength = end > start ? end - start : 0; | |
| 1120 | 1120 | return new FastBuffer(this.buffer, this.byteOffset + start, newLength); | |
| 1121 | 1121 | }; | |
| 1122 | 1122 | ||
| 1123 | + Buffer.prototype.slice = function slice(start, end) { | ||
| 1124 | + return this.subarray(start, end); | ||
| 1125 | + }; | ||
| 1126 | + | ||
| 1123 | 1127 | function swap(b, n, m) { | |
| 1124 | 1128 | const i = b[n]; | |
| 1125 | 1129 | b[n] = b[m]; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments