MCPcopy
hub / github.com/lxzan/gws / shouldCall

Method shouldCall

writefile.go:142–152  ·  view source on GitHub ↗

是否可以执行回调函数 Whether the callback function can be executed

()

Source from the content-addressed store, hash-verified

140// 是否可以执行回调函数
141// Whether the callback function can be executed
142func (c *flateWriter) shouldCall() bool {
143 var n = len(c.buffers)
144 if n < 2 {
145 return false
146 }
147 var sum = 0
148 for i := 1; i < n; i++ {
149 sum += c.buffers[i].Len()
150 }
151 return sum >= 4
152}
153
154// 聚合写入, 减少syscall.write调用次数
155// Aggregate writes, reducing the number of syscall.write calls

Callers 1

WriteMethod · 0.95

Calls 1

LenMethod · 0.65

Tested by

no test coverage detected