File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines 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 ] ;
You can’t perform that action at this time.
0 commit comments