[#857] config: use size suffixes where possible

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-10-07 19:17:07 +03:00 committed by Leonard Lyubich
parent a0abf10c8e
commit 00f14d4dcd
3 changed files with 6 additions and 6 deletions

View file

@ -32,7 +32,7 @@ func From(c *config.Config) *Config {
//
// Returns SizeDefault if value is not a positive number.
func (x *Config) Size() uint64 {
s := config.UintSafe(
s := config.SizeInBytesSafe(
(*config.Config)(x),
"size",
)

View file

@ -92,7 +92,7 @@ func (x *Config) Compress() bool {
//
// Returns SmallSizeLimitDefault if value is not a positive number.
func (x *Config) SmallSizeLimit() uint64 {
l := config.UintSafe(
l := config.SizeInBytesSafe(
(*config.Config)(x),
"small_size_limit",
)

View file

@ -51,7 +51,7 @@ func (x *Config) Path() string {
//
// Returns MemSizeDefault if value is not a positive number.
func (x *Config) MemSize() uint64 {
s := config.UintSafe(
s := config.SizeInBytesSafe(
(*config.Config)(x),
"mem_size",
)
@ -67,7 +67,7 @@ func (x *Config) MemSize() uint64 {
//
// Returns SmallSizeDefault if value is not a positive number.
func (x *Config) SmallObjectSize() uint64 {
s := config.UintSafe(
s := config.SizeInBytesSafe(
(*config.Config)(x),
"small_size",
)
@ -83,7 +83,7 @@ func (x *Config) SmallObjectSize() uint64 {
//
// Returns MaxSizeDefault if value is not a positive number.
func (x *Config) MaxObjectSize() uint64 {
s := config.UintSafe(
s := config.SizeInBytesSafe(
(*config.Config)(x),
"max_size",
)
@ -115,7 +115,7 @@ func (x *Config) WorkersNumber() int {
//
// Returns SizeLimitDefault if value is not a positive number.
func (x *Config) SizeLimit() uint64 {
c := config.UintSafe(
c := config.SizeInBytesSafe(
(*config.Config)(x),
"size_limit",
)