MCPcopy Create free account
hub / github.com/blues/note / binAppendInt40

Method binAppendInt40

lib/bulk.go:1403–1425  ·  view source on GitHub ↗
(ctx context.Context, value int64)

Source from the content-addressed store, hash-verified

1401}
1402
1403func (tmplContext *BulkTemplateContext) binAppendInt40(ctx context.Context, value int64) (err error) {
1404 if debugEncoding {
1405 logDebug(ctx, "append %d INT40 = %d", tmplContext.binDepth, value)
1406 }
1407 err = tmplContext.binAppendUint8(ctx, uint8(value&0xff))
1408 value = value >> 8
1409 if err == nil {
1410 err = tmplContext.binAppendUint8(ctx, uint8(value&0xff))
1411 }
1412 value = value >> 8
1413 if err == nil {
1414 err = tmplContext.binAppendUint8(ctx, uint8(value&0xff))
1415 }
1416 value = value >> 8
1417 if err == nil {
1418 err = tmplContext.binAppendUint8(ctx, uint8(value&0xff))
1419 }
1420 value = value >> 8
1421 if err == nil {
1422 err = tmplContext.binAppendUint8(ctx, uint8(value&0xff))
1423 }
1424 return err
1425}
1426
1427func (tmplContext *BulkTemplateContext) binAppendUint40(ctx context.Context, value uint64) (err error) {
1428 if debugEncoding {

Callers 1

processTemplateValueMethod · 0.95

Calls 2

binAppendUint8Method · 0.95
logDebugFunction · 0.85

Tested by

no test coverage detected