Skip to content

Commit 0fac705

Browse files
authored
compression/rle: delete RLE compression (#16468)
1 parent 315b9b1 commit 0fac705

File tree

4 files changed

+2
-170
lines changed

4 files changed

+2
-170
lines changed

compression/rle/read_write.go

Lines changed: 0 additions & 101 deletions
This file was deleted.

compression/rle/read_write_test.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

ethdb/database.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ func (db *LDBDatabase) Path() string {
9191

9292
// Put puts the given key / value to the queue
9393
func (db *LDBDatabase) Put(key []byte, value []byte) error {
94-
// Generate the data to write to disk, update the meter and write
95-
//value = rle.Compress(value)
96-
9794
return db.db.Put(key, value, nil)
9895
}
9996

@@ -103,18 +100,15 @@ func (db *LDBDatabase) Has(key []byte) (bool, error) {
103100

104101
// Get returns the given key if it's present.
105102
func (db *LDBDatabase) Get(key []byte) ([]byte, error) {
106-
// Retrieve the key and increment the miss counter if not found
107103
dat, err := db.db.Get(key, nil)
108104
if err != nil {
109105
return nil, err
110106
}
111107
return dat, nil
112-
//return rle.Decompress(dat)
113108
}
114109

115110
// Delete deletes the key from the queue and database
116111
func (db *LDBDatabase) Delete(key []byte) error {
117-
// Execute the actual operation
118112
return db.db.Delete(key, nil)
119113
}
120114

swarm/storage/database.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ package storage
2222
import (
2323
"fmt"
2424

25-
"github.com/ethereum/go-ethereum/compression/rle"
2625
"github.com/syndtr/goleveldb/leveldb"
2726
"github.com/syndtr/goleveldb/leveldb/iterator"
2827
"github.com/syndtr/goleveldb/leveldb/opt"
@@ -31,8 +30,7 @@ import (
3130
const openFileLimit = 128
3231

3332
type LDBDatabase struct {
34-
db *leveldb.DB
35-
comp bool
33+
db *leveldb.DB
3634
}
3735

3836
func NewLDBDatabase(file string) (*LDBDatabase, error) {
@@ -42,16 +40,12 @@ func NewLDBDatabase(file string) (*LDBDatabase, error) {
4240
return nil, err
4341
}
4442

45-
database := &LDBDatabase{db: db, comp: false}
43+
database := &LDBDatabase{db: db}
4644

4745
return database, nil
4846
}
4947

5048
func (self *LDBDatabase) Put(key []byte, value []byte) {
51-
if self.comp {
52-
value = rle.Compress(value)
53-
}
54-
5549
err := self.db.Put(key, value, nil)
5650
if err != nil {
5751
fmt.Println("Error put", err)
@@ -63,11 +57,6 @@ func (self *LDBDatabase) Get(key []byte) ([]byte, error) {
6357
if err != nil {
6458
return nil, err
6559
}
66-
67-
if self.comp {
68-
return rle.Decompress(dat)
69-
}
70-
7160
return dat, nil
7261
}
7362

0 commit comments

Comments
 (0)