shareable: Rename variables

This commit is contained in:
Hajime Hoshi 2018-03-24 04:27:10 +09:00
parent b92bc6f21c
commit b15fb523a8

View File

@ -185,34 +185,34 @@ func NewImage(width, height int) *Image {
defer backendsM.Unlock() defer backendsM.Unlock()
if width > maxSize || height > maxSize { if width > maxSize || height > maxSize {
s := &backend{ b := &backend{
restorable: restorable.NewImage(width, height, false), restorable: restorable.NewImage(width, height, false),
} }
return &Image{ return &Image{
backend: s, backend: b,
} }
} }
for _, s := range theBackends { for _, b := range theBackends {
if n := s.page.Alloc(width, height); n != nil { if n := b.page.Alloc(width, height); n != nil {
return &Image{ return &Image{
backend: s, backend: b,
node: n, node: n,
} }
} }
} }
s := &backend{ b := &backend{
restorable: restorable.NewImage(maxSize, maxSize, false), restorable: restorable.NewImage(maxSize, maxSize, false),
page: packing.NewPage(maxSize, maxSize), // TODO: Utilize 'Extend' page. page: packing.NewPage(maxSize, maxSize), // TODO: Utilize 'Extend' page.
} }
theBackends = append(theBackends, s) theBackends = append(theBackends, b)
n := s.page.Alloc(width, height) n := b.page.Alloc(width, height)
if n == nil { if n == nil {
panic("not reached") panic("not reached")
} }
i := &Image{ i := &Image{
backend: s, backend: b,
node: n, node: n,
} }
runtime.SetFinalizer(i, (*Image).Dispose) runtime.SetFinalizer(i, (*Image).Dispose)