fix: Function params involve heavy amount of copying (#622)
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
// New func implements the storage interface for gorush (https://github.com/appleboy/gorush)
|
||||
func New(config config.ConfYaml) *Storage {
|
||||
func New(config *config.ConfYaml) *Storage {
|
||||
return &Storage{
|
||||
config: config,
|
||||
}
|
||||
@@ -21,7 +21,7 @@ func New(config config.ConfYaml) *Storage {
|
||||
|
||||
// Storage is interface structure
|
||||
type Storage struct {
|
||||
config config.ConfYaml
|
||||
config *config.ConfYaml
|
||||
opts badger.Options
|
||||
name string
|
||||
db *badger.DB
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// New func implements the storage interface for gorush (https://github.com/appleboy/gorush)
|
||||
func New(config config.ConfYaml) *Storage {
|
||||
func New(config *config.ConfYaml) *Storage {
|
||||
return &Storage{
|
||||
config: config,
|
||||
}
|
||||
@@ -18,7 +18,7 @@ func New(config config.ConfYaml) *Storage {
|
||||
|
||||
// Storage is interface structure
|
||||
type Storage struct {
|
||||
config config.ConfYaml
|
||||
config *config.ConfYaml
|
||||
db *storm.DB
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// New func implements the storage interface for gorush (https://github.com/appleboy/gorush)
|
||||
func New(config config.ConfYaml) *Storage {
|
||||
func New(config *config.ConfYaml) *Storage {
|
||||
return &Storage{
|
||||
config: config,
|
||||
}
|
||||
@@ -20,7 +20,7 @@ func New(config config.ConfYaml) *Storage {
|
||||
|
||||
// Storage is interface structure
|
||||
type Storage struct {
|
||||
config config.ConfYaml
|
||||
config *config.ConfYaml
|
||||
db *buntdb.DB
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ func (s *Storage) getLevelDB(key string, count *int64) {
|
||||
}
|
||||
|
||||
// New func implements the storage interface for gorush (https://github.com/appleboy/gorush)
|
||||
func New(config config.ConfYaml) *Storage {
|
||||
func New(config *config.ConfYaml) *Storage {
|
||||
return &Storage{
|
||||
config: config,
|
||||
}
|
||||
@@ -29,7 +29,7 @@ func New(config config.ConfYaml) *Storage {
|
||||
|
||||
// Storage is interface structure
|
||||
type Storage struct {
|
||||
config config.ConfYaml
|
||||
config *config.ConfYaml
|
||||
db *leveldb.DB
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// New func implements the storage interface for gorush (https://github.com/appleboy/gorush)
|
||||
func New(config config.ConfYaml) *Storage {
|
||||
func New(config *config.ConfYaml) *Storage {
|
||||
return &Storage{
|
||||
config: config,
|
||||
}
|
||||
@@ -23,7 +23,7 @@ func (s *Storage) getInt64(key string, count *int64) {
|
||||
|
||||
// Storage is interface structure
|
||||
type Storage struct {
|
||||
config config.ConfYaml
|
||||
config *config.ConfYaml
|
||||
client *redis.Client
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user