remove unneded casts

This commit is contained in:
vyzo 2021-12-28 16:34:19 +02:00
parent b126e3b71e
commit 1ea897ee4d

View File

@ -78,7 +78,7 @@ func NewTxnResourceScope(owner *ResourceScope) *ResourceScope {
// Resources implementation // Resources implementation
func (rc *Resources) checkMemory(rsvp int64) error { func (rc *Resources) checkMemory(rsvp int64) error {
// overflow check; this also has the side effect that we cannot reserve negative memory. // overflow check; this also has the side effect that we cannot reserve negative memory.
newmem := rc.memory + int64(rsvp) newmem := rc.memory + rsvp
if newmem < rc.memory { if newmem < rc.memory {
return fmt.Errorf("memory reservation overflow: %w", ErrResourceLimitExceeded) return fmt.Errorf("memory reservation overflow: %w", ErrResourceLimitExceeded)
} }
@ -103,7 +103,7 @@ func (rc *Resources) reserveMemory(size int64) error {
return err return err
} }
rc.memory += int64(size) rc.memory += size
return nil return nil
} }