diff options
author | Casey Dahlin <cdahlin@redhat.com> | 2008-10-09 01:44:19 -0400 |
---|---|---|
committer | Casey Dahlin <cdahlin@redhat.com> | 2008-10-09 01:47:08 -0400 |
commit | 45c7cf611b96ee7b5aa85bb18feafe29f270c7e0 (patch) | |
tree | d13e75b7277329463acffa46a8ca6b8fc29413aa /state.rb | |
parent | 3bda19aa69df2422ee193b2f7e75d3cc4e6c6ac9 (diff) | |
download | upstate-45c7cf611b96ee7b5aa85bb18feafe29f270c7e0.tar.gz upstate-45c7cf611b96ee7b5aa85bb18feafe29f270c7e0.tar.xz upstate-45c7cf611b96ee7b5aa85bb18feafe29f270c7e0.zip |
Properly deterministic hashing that accounts for deps
State#hash now gives consistent results (finally) and takes deps into account
(again)
Diffstat (limited to 'state.rb')
-rw-r--r-- | state.rb | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -214,7 +214,9 @@ class State # Our ID is a function of our class and deps def hash - (self.class.hash ** 2 + self.params.sort.hash) % 0x4000000000000000 + (self.class.name.hash ** 3 + + self.params.sort.hash ** 2 + + @deps.map{ |x| x.state.hash }.sort.hash) % 0x4000000000000000 end # A state is rooted in a set of states if any state in the set which it _may_ |