Removed unused parameters.
parent
caf7ecf366
commit
d90be1a6b5
|
@ -180,7 +180,7 @@ func (c *Collection[T]) loadData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collection[T]) onStore(collection string, id uint64, data []byte) {
|
func (c *Collection[T]) onStore(id uint64, data []byte) {
|
||||||
item := decode[T](data)
|
item := decode[T](data)
|
||||||
old, ok := c.items.Get(id)
|
old, ok := c.items.Get(id)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -196,7 +196,7 @@ func (c *Collection[T]) onStore(collection string, id uint64, data []byte) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collection[T]) onDelete(collection string, id uint64) {
|
func (c *Collection[T]) onDelete(id uint64) {
|
||||||
if item, ok := c.items.Get(id); ok {
|
if item, ok := c.items.Get(id); ok {
|
||||||
for _, idx := range c.indices {
|
for _, idx := range c.indices {
|
||||||
idx.delete(item)
|
idx.delete(item)
|
||||||
|
|
|
@ -81,14 +81,14 @@ func (db *Database) Close() {
|
||||||
func (db *Database) onStore(collection string, id uint64, data []byte) {
|
func (db *Database) onStore(collection string, id uint64, data []byte) {
|
||||||
c, ok := db.collections[collection]
|
c, ok := db.collections[collection]
|
||||||
if ok {
|
if ok {
|
||||||
c.onStore(collection, id, data)
|
c.onStore(id, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *Database) onDelete(collection string, id uint64) {
|
func (db *Database) onDelete(collection string, id uint64) {
|
||||||
c, ok := db.collections[collection]
|
c, ok := db.collections[collection]
|
||||||
if ok {
|
if ok {
|
||||||
c.onDelete(collection, id)
|
c.onDelete(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
types.go
4
types.go
|
@ -23,6 +23,6 @@ type itemUniqueIndex[T any] interface {
|
||||||
|
|
||||||
type dbCollection interface {
|
type dbCollection interface {
|
||||||
loadData()
|
loadData()
|
||||||
onStore(string, uint64, []byte) // For WAL following.
|
onStore(uint64, []byte) // For WAL following.
|
||||||
onDelete(string, uint64) // For WAL following.
|
onDelete(uint64) // For WAL following.
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue