MCPcopy Index your code
hub / github.com/borgbackup/borg / pop_front

Method pop_front

src/borg/helpers/datastruct.py:85–101  ·  view source on GitHub ↗

Remove the first `size` elements from the queue. Raises an error if the requested removal size is larger than the entire queue.

(self, size)

Source from the content-addressed store, hash-verified

83 return buffer
84
85 def pop_front(self, size):
86 """
87 Remove the first `size` elements from the queue.
88 Raises an error if the requested removal size is larger than the entire queue.
89 """
90 if size > self.size:
91 raise EfficientCollectionQueue.SizeUnderflow(size, self.size)
92 while size > 0:
93 buffer = self.buffers[0]
94 to_remove = min(size, len(buffer))
95 buffer = buffer[to_remove:]
96 if buffer:
97 self.buffers[0] = buffer
98 else:
99 del self.buffers[0]
100 size -= to_remove
101 self.size -= to_remove
102
103 def push_back(self, data):
104 """

Callers 5

test_base_usageMethod · 0.95
test_chunkingMethod · 0.95
send_bufferMethod · 0.80
send_bufferMethod · 0.80

Calls

no outgoing calls

Tested by 3

test_base_usageMethod · 0.76
test_chunkingMethod · 0.76