MCPcopy Index your code
hub / github.com/UI5/webcomponents / fromListPartial

Function fromListPartial

packages/main/test/pages/diffable-html.js:6983–6997  ·  view source on GitHub ↗
(n, list, hasStrings)

Source from the content-addressed store, hash-verified

6981 // This function is designed to be inlinable, so please take care when making
6982 // changes to the function body.
6983 function fromListPartial(n, list, hasStrings) {
6984 var ret;
6985 if (n < list.head.data.length) {
6986 // slice is the same for buffers and strings
6987 ret = list.head.data.slice(0, n);
6988 list.head.data = list.head.data.slice(n);
6989 } else if (n === list.head.data.length) {
6990 // first chunk is a perfect match
6991 ret = list.shift();
6992 } else {
6993 // result spans more than one buffer
6994 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
6995 }
6996 return ret;
6997 }
6998
6999 // Copies a specified amount of characters from the list of buffered data
7000 // chunks.

Callers 1

fromListFunction · 0.85

Calls 3

copyFromBufferStringFunction · 0.85
copyFromBufferFunction · 0.85
shiftMethod · 0.80

Tested by

no test coverage detected