MCPcopy Create free account
hub / github.com/Effect-TS/effect / appendAllUnsafe

Function appendAllUnsafe

packages/effect/src/MutableList.ts:351–368  ·  view source on GitHub ↗
(self: MutableList<A>, messages: ReadonlyArray<A>, mutable = false)

Source from the content-addressed store, hash-verified

349 * @since 4.0.0
350 */
351export const appendAllUnsafe = <A>(self: MutableList<A>, messages: ReadonlyArray<A>, mutable = false): number => {
352 if (messages.length === 0) {
353 return 0
354 }
355 const chunk: MutableList.Bucket<A> = {
356 array: messages as Array<A>,
357 mutable,
358 offset: 0,
359 next: undefined
360 }
361 if (self.head) {
362 self.tail = self.tail!.next = chunk
363 } else {
364 self.head = self.tail = chunk
365 }
366 self.length += messages.length
367 return messages.length
368}
369
370/**
371 * Removes all elements from the MutableList, resetting it to an empty state.

Callers 1

appendAllFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected