diff options
author | EuAndreh <eu@euandre.org> | 2025-01-24 19:39:55 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-01-24 19:39:55 -0300 |
commit | 469f0ce9f8ed18fb6442d6810779b9922ed0aa92 (patch) | |
tree | a19e9ab2a77e6dc6632823e8b193de7a9de048d4 /src/dedo.go | |
parent | src/dedo.go: Remove old CLI code (~2k LoC!!) (diff) | |
download | dedo-469f0ce9f8ed18fb6442d6810779b9922ed0aa92.tar.gz dedo-469f0ce9f8ed18fb6442d6810779b9922ed0aa92.tar.xz |
Remove other unused code
Diffstat (limited to 'src/dedo.go')
-rw-r--r-- | src/dedo.go | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/dedo.go b/src/dedo.go index 62dc457..d5a39b7 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -1629,16 +1629,6 @@ func (db *DB) Path() string { return db.path } -// GoString returns the Go string representation of the database. -func (db *DB) GoString() string { - return fmt.Sprintf("bolt.DB{path:%q}", db.path) -} - -// String returns the string representation of the database. -func (db *DB) String() string { - return fmt.Sprintf("DB<%q>", db.path) -} - func newDB(path string, file *os.File) *DB { return &DB{ MaxBatchSize: DefaultMaxBatchSize, @@ -2367,10 +2357,6 @@ func (s *Stats) Sub(other *Stats) Stats { return diff } -func (s *Stats) add(other *Stats) { - s.TxStats.add(&other.TxStats) -} - // validate checks the marker bytes and version of the meta page to ensure it matches this binary. func (m *meta) validate() error { if m.magic != magic { @@ -3235,33 +3221,6 @@ func (n *node) free() { } } -// dump writes the contents of the node to STDERR for debugging purposes. -/* -func (n *node) dump() { - // Write node header. - var typ = "branch" - if n.isLeaf { - typ = "leaf" - } - warnf("[NODE %d {type=%s count=%d}]", n.pgid, typ, len(n.inodes)) - - // Write out abbreviated version of each item. - for _, item := range n.inodes { - if n.isLeaf { - if item.flags&bucketLeafFlag != 0 { - bucket := (*bucket)(unsafe.Pointer(&item.value[0])) - warnf("+L %08x -> (bucket root=%d)", trunc(item.key, 4), bucket.root) - } else { - warnf("+L %08x -> %08x", trunc(item.key, 4), trunc(item.value, 4)) - } - } else { - warnf("+B %08x -> pgid=%d", trunc(item.key, 4), item.pgid) - } - } - warn("") -} -*/ - func (s nodes) Len() int { return len(s) } func (s nodes) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s nodes) Less(i, j int) bool { return bytes.Compare(s[i].inodes[0].key, s[j].inodes[0].key) == -1 } @@ -3312,12 +3271,6 @@ func (p *page) branchPageElements() []branchPageElement { return ((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[:] } -// dump writes n bytes of the page to STDERR as hex output. -func (p *page) hexdump(n int) string { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(p))[:n] - return fmt.Sprintf("%x\n", buf) -} - func (s pages) Len() int { return len(s) } func (s pages) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s pages) Less(i, j int) bool { return s[i].id < s[j].id } |