From: ts Date: 2001-02-28T19:26:06+09:00 Subject: [ruby-talk:11759] Re: Comparison Caching >>>>> "B" == Ben Tilly writes: This is what it do, except here B> def visited? (this, that) B> if @seen[this].nil? B> @seen[this] = [ that ] B> else B> return true if @seen[this].include? that B> @seen[this].push that B> end B> false B> end def visited?(this, that) this, that = that, this if this > that return true if $seen[[this, that]] $seen[[this, that]] = true false end $seen is a thread local variable. I don't know which version is faster. Guy Decoux