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 @@ -1113,14 +1113,18 @@ function adjustOffset(offset, length) {
1113
1113
return NumberIsNaN ( offset ) ? 0 : length ;
1114
1114
}
1115
1115
1116
- Buffer . prototype . slice = function slice ( start , end ) {
1116
+ Buffer . prototype . subarray = function subarray ( start , end ) {
1117
1117
const srcLength = this . length ;
1118
1118
start = adjustOffset ( start , srcLength ) ;
1119
1119
end = end !== undefined ? adjustOffset ( end , srcLength ) : srcLength ;
1120
1120
const newLength = end > start ? end - start : 0 ;
1121
1121
return new FastBuffer ( this . buffer , this . byteOffset + start , newLength ) ;
1122
1122
} ;
1123
1123
1124
+ Buffer . prototype . slice = function slice ( start , end ) {
1125
+ return this . subarray ( start , end ) ;
1126
+ } ;
1127
+
1124
1128
function swap ( b , n , m ) {
1125
1129
const i = b [ n ] ;
1126
1130
b [ n ] = b [ m ] ;
You can’t perform that action at this time.
0 commit comments