[bknr-cvs] ksprotte changed trunk/projects/bos/m2/allocation.lisp
BKNR Commits
bknr at bknr.net
Thu Jul 24 13:12:57 UTC 2008
Revision: 3617
Author: ksprotte
URL: http://bknr.net/trac/changeset/3617
made search-adjacent more robust for the (pathological) cases of the test-suite
U trunk/projects/bos/m2/allocation.lisp
Modified: trunk/projects/bos/m2/allocation.lisp
===================================================================
--- trunk/projects/bos/m2/allocation.lisp 2008-07-24 12:46:58 UTC (rev 3616)
+++ trunk/projects/bos/m2/allocation.lisp 2008-07-24 13:12:57 UTC (rev 3617)
@@ -304,10 +304,12 @@
(setf (gethash m2 allocated) t)
(enqueue m2 border-queue))
(try-get (x y)
- (let ((m2 (ensure-m2 x y)))
- (when (and (not (gethash m2 allocated))
- (funcall pred m2))
- m2)))
+ (when (and (<= 0 x (1- +width+))
+ (<= 0 y (1- +width+)))
+ (let ((m2 (ensure-m2 x y)))
+ (when (and (not (gethash m2 allocated))
+ (funcall pred m2))
+ m2))))
(get-next-neighbor (m2)
(let ((x (m2-x m2))
(y (m2-y m2)))
More information about the Bknr-cvs
mailing list