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

Function copyFromBufferString

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

Source from the content-addressed store, hash-verified

7001 // This function is designed to be inlinable, so please take care when making
7002 // changes to the function body.
7003 function copyFromBufferString(n, list) {
7004 var p = list.head;
7005 var c = 1;
7006 var ret = p.data;
7007 n -= ret.length;
7008 while (p = p.next) {
7009 var str = p.data;
7010 var nb = n > str.length ? str.length : n;
7011 if (nb === str.length) ret += str;else ret += str.slice(0, n);
7012 n -= nb;
7013 if (n === 0) {
7014 if (nb === str.length) {
7015 ++c;
7016 if (p.next) list.head = p.next;else list.head = list.tail = null;
7017 } else {
7018 list.head = p;
7019 p.data = str.slice(nb);
7020 }
7021 break;
7022 }
7023 ++c;
7024 }
7025 list.length -= c;
7026 return ret;
7027 }
7028
7029 // Copies a specified amount of bytes from the list of buffered data chunks.
7030 // This function is designed to be inlinable, so please take care when making

Callers 1

fromListPartialFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected