summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-02-26 00:06:26 +0100
committerDimitri Sokolyuk <demon@dim13.org>2017-02-26 00:06:26 +0100
commit46f72c2afabd5c9638aff65191be5f80ab17f9a8 (patch)
treed505dc50d487427245aacc989e6e8ead4864830f
parent779a38d11b7c3ecef940062952210e1b5da8f669 (diff)
Cleanup
-rw-r--r--philo.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/philo.go b/philo.go
index d5bc02a..930b23f 100644
--- a/philo.go
+++ b/philo.go
@@ -28,13 +28,13 @@ func (p Philo) Print(s string) {
fmt.Printf("%10s %s\n", p.Name, s)
}
-func (p *Philo) Arrive() stateFn {
+func (p Philo) Arrive() stateFn {
p.Print("arrives")
return p.Hungry
}
-func (p *Philo) Hungry() stateFn {
+func (p Philo) Hungry() stateFn {
p.Print("is hungry")
p.Left.Grab()
@@ -46,7 +46,7 @@ func (p *Philo) Hungry() stateFn {
return p.Starve
}
-func (p *Philo) Starve() stateFn {
+func (p Philo) Starve() stateFn {
p.Print("is starving")
p.Delay()
@@ -67,14 +67,14 @@ func (p *Philo) Eat() stateFn {
return p.Think
}
-func (p *Philo) Think() stateFn {
+func (p Philo) Think() stateFn {
p.Print("is thinking")
p.Delay()
return p.Hungry
}
-func (p *Philo) Leave() stateFn {
+func (p Philo) Leave() stateFn {
p.Print("leaves")
return nil
@@ -82,7 +82,7 @@ func (p *Philo) Leave() stateFn {
type stateFn func() stateFn
-func (p *Philo) Dine() {
+func (p Philo) Dine() {
for state := p.Arrive; state != nil; {
state = state()
}