<div><span class="gmail_quote">On 11/13/07, <b class="gmail_sendername">Ryan Ingram</b> &lt;<a href="mailto:ryani.spam@gmail.com">ryani.spam@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Also, what stops getRule from going off the end of the array?&nbsp; I didn&#39;t see anything that prevented that in the code, and you&#39;re using unsafeAt, which seems like a potential bug.</div></blockquote>
<div>&nbsp;</div>
<div>Never mind, I realized this is a ring buffer with&nbsp;`mod` s.&nbsp;&nbsp; That&#39;s another slow operation when you&#39;re doing code as tight as this.&nbsp; If you can guarantee the ring is a power of 2 in size you can use a mask instead, or use my original suggestion of deriving rules from the previous rule and the new bit; the initial state is determined by the last bits&nbsp;in the buffer and you never wrap.
</div>
<div>&nbsp;</div>
<div>&nbsp; -- ryan</div></div>