1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-17 13:56:01 +00:00
This commit is contained in:
MatteZ02
2020-03-03 22:30:50 +02:00
parent edfcc6f474
commit 30022c7634
11800 changed files with 1984416 additions and 1 deletions

25
node_modules/bytebuffer/src/methods/reverse.js generated vendored Normal file
View File

@ -0,0 +1,25 @@
/**
* Reverses this ByteBuffer's contents.
* @param {number=} begin Offset to start at, defaults to {@link ByteBuffer#offset}
* @param {number=} end Offset to end at, defaults to {@link ByteBuffer#limit}
* @returns {!ByteBuffer} this
* @expose
*/
ByteBufferPrototype.reverse = function(begin, end) {
if (typeof begin === 'undefined') begin = this.offset;
if (typeof end === 'undefined') end = this.limit;
if (!this.noAssert) {
//? ASSERT_RANGE();
}
if (begin === end)
return this; // Nothing to reverse
//? if (NODE)
Array.prototype.reverse.call(this.buffer.slice(begin, end));
//? else if (DATAVIEW) {
Array.prototype.reverse.call(new Uint8Array(this.buffer).subarray(begin, end));
this.view = new DataView(this.buffer); // FIXME: Why exactly is this necessary?
//? } else {
Array.prototype.reverse.call(this.view.subarray(begin, end));
//? }
return this;
};